SlideShare a Scribd company logo
1
CSE211
Computer Organization and
Design
Lecture : 3 Tutorial: 1 Practical: 0 Credit: 4
Ritika Sharma
(Asst. Professor, LPU)
Basic Computer Organization and Design 2
CSE 211
Overview
 Instruction Codes
 Computer Registers
 Computer Instructions
 Timing and Control
 Instruction Cycle
 Memory Reference Instructions
 Input-Output and Interrupt
 Complete Computer Description
Basic Computer Organization and Design 3
CSE 211
Introduction
• Organization of computer is defined by its :
• Internal Registers
• Timing and Control Structure
• Set of instructions that it uses
• Every different processor type has its own design (different registers, buses,
microoperations, machine instructions, etc)
• Modern processor is a very complex device
• It contains
– Many registers
– Multiple arithmetic units, for both integer and floating point calculations
– The ability to pipeline several consecutive instructions to speed execution
– Etc.
• However, to understand how processors work, we will start with a
simplified processor model
Basic Computer Organization and Design 4
CSE 211
Basic Computer
• The Basic Computer has two components, a processor and memory
• The memory has 4096 words in it
– 4096 = 212, so it takes 12 bits to select a word in memory
• Each word is 16 bits long
CPU RAM
0
4095
015
 OpcodeAdd(110110)
Code is decoded in CU
Comp.issues control signals to read operand
from mem.& add the operand to Processor
register.
Basic Computer Organization and Design 6
CSE 211
Instruction
 Program
 A sequence of (machine) instructions
 Instruction
 binary code that specifies a sequence of microoperations for a
computer.
 The instructions of a program, along with any needed data are stored in
memory
 The CPU reads the next instruction from memory
 It is placed in an Instruction Register (IR)
 Control circuitry in control unit then translates the instruction into the
sequence of microoperations necessary to implement it
Basic Computer Organization and Design 7
CSE 211
Instruction Format
 Instruction Codes
 A group of bits that tell the computer to perform a specific operation (a
sequence of micro-operation)
 A computer instruction is often divided into two parts
 An opcode (Operation Code) that specifies the operation for that instruction
 Sometimes called as Macrooperation
 An address that specifies the registers and/or locations in memory to use for
that operation
 In the Basic Computer, the memory contains 4096 (= 212) words, we needs 12 bit to
specify which memory address this instruction will use
 In the Basic Computer, bit 15 of the instruction specifies the addressing mode (0:
direct addressing, 1: indirect addressing)
 Since the memory words, and hence the instructions, are 16 bits long, that leaves 3
bits for the instruction’s opcode
Basic Computer Organization and Design 8
CSE 211
Instruction Format
 Sometimes the address bit of instruction code represent various different
information, classified into different Instruction formats :
 Immediate Instruction : when second part of instruction specifies operand
 When second part of address specify address :
 Direct Addressing : second part of instruction specifies address of an
operand
 Indirect Addressing : second part of instruction designates an address of a
memory in which the address of the operand is found
Opcode Address
Instruction Format
15 14 12 0
I
11
Addressing
mode
Basic Computer Organization and Design 9
CSE 211
Addressing Mode
• The address field of an instruction can represent either
– Direct address: the address in memory of the data to use (the address of the operand), or
– Indirect address: the address in memory of the address in memory of the data to use
• Effective Address (EA)
– The address, that can be directly used without modification to access an operand for a
computation-type instruction, or as the target address for a branch-type instruction
0 ADD 45722
Operand457
1 ADD 30035
1350300
Operand1350
+
AC
+
AC
Direct addressing Indirect addressing
Basic Computer Organization and Design 10
CSE 211
Processor Register
 A processor has many registers to hold instructions, addresses, data, etc
 The processor has a register, the Program Counter (PC) that holds the
memory address of the next instruction to be executed
Since the memory in the Basic Computer only has 4096 locations,
the PC only needs 12 bits
 In a direct or indirect addressing, the processor needs to keep track of
what locations in memory it is addressing: The Address Register (AR) is
used for this
The AR is a 12 bit register in the Basic Computer
 When an operand is found, using either direct or indirect addressing, it
is placed in the Data Register (DR). The processor then uses this value as
data for its operation
 The Basic Computer has a single general purpose register – the
Accumulator (AC)
Basic Computer Organisation and Design 11
CSE 211
Processor Register
 The significance of a general purpose register is that it can be referred to in
instructions
e.g. load AC with the contents of a specific memory location; store the contents of AC
into a specified memory location
 Often a processor will need a scratch register to store intermediate results
or other temporary data; in the Basic Computer this is the Temporary
Register (TR)
 The Basic Computer uses a very simple model of input/output (I/O)
operations
Input devices are considered to send 8 bits of character data to the processor
The processor can send 8 bits of character data to output devices
 The Input Register (INPR) holds an 8 bit character gotten from an input
device
 The Output Register (OUTR) holds an 8 bit character to be send to an
output device
Basic Computer Organization and Design 13
CSE 211
Processor Register
List of BC Registers
DR 16 Data Register Holds memory operand
AR 12 Address Register Holds address for memory
AC 16 Accumulator Processor register
IR 16 Instruction Register Holds instruction code
PC 12 Program Counter Holds address of instruction
TR 16 Temporary Register Holds temporary data
INPR 8 Input Register Holds input character
OUTR 8 Output Register Holds output character
Registers in the Basic Computer
11 0
PC
15 0
IR
15 0
TR
7 0
OUTR
15 0
DR
15 0
AC
11 0
AR
INPR
0 7
Memory
4096 x 16
CPU
Basic Computer Organization and Design 14
CSE 211
Common Bus System
 Basic computer : 8 register, a memory unit and a control unit
 The registers in the Basic Computer are connected using a bus
 This gives a savings in circuitry over complete connections between
registers
 Output of 6 register and memory connected to input of bus
 Specific output that is selected for bus lines will be determined by
selection variables S2, S1, S0
Basic Computer Organization and Design 15
CSE 211
Common Bus System
S1
S0
Bus
Memory unit
4096 x 16
LD INR CLR
Address
ReadWrite
AR
LD INR CLR
PC
LD INR CLR
DR
LD INR CLR
ACALU
E
INPR
IR
LD
LD INR CLR
TR
OUTR
LD
Clock
7
1
2
3
4
5
6
S2
Basic Computer Organization and Design
CSE 211
Common Bus System
 Three control lines, S2, S1, and S0 control which register the bus
selects as its input
 Either one of the registers will have its load signal activated, or the
memory will have its write signal activated
Will determine where the data from the bus gets loaded
 Memory places its 16 bit output on bus when read input is
activated and S2S1S0=111
0 0 0 x
0 0 1 AR
0 1 0 PC
0 1 1 DR
1 0 0 AC
1 0 1 IR
1 1 0 TR
1 1 1 Memory
S2 S1 S0 Register
Basic Computer Organization and Design
CSE 211
Common Bus System
 4 register DR, AC, IR, TR is 16 bit. The 12-bit registers, AR and PC,
have 0’s loaded onto the bus in the high order 4 bit positions
 When the 8-bit register OUTR is loaded from the bus, the data
comes from the low order 8 bits on the bus
 INPR – connected to provide information to bus
- receives character from input device and transfer to AC
 OUTR – can only receive information from bus
- receives a character from AC and delivers to Output device
 Three types of input to AC :
 from AC : complement AC, Shift AC
 from DR : arithmetic and logic microoperation
 from INPR
Basic Computer Organization and Design
CSE 211
Common Bus System
 Bus lines connected to inputs of 6 registers and memory
 Three types of input to AC :
 from AC : complement AC, Shift AC
 from DR : arithmetic and logic microoperation
 from INPR
 Input/output data connected to common bus but memory address
connected to AR
Basic Computer Organization and Design 19
CSE 211
Basic Computer Instructions
Basic Computer Instruction Format
15 14 12 11 0
I Opcode Address
1. Memory-Reference Instructions (OP-code = 000 ~ 110)
2. Register-Reference Instructions (OP-code = 111, I = 0)
3. Input-Output Instructions (OP-code =111, I = 1)
15 12 11 0
Register operation0 1 1 1
15 12 11 0
I/O operation1 1 1 1
Basic Computer Organization and Design 20
CSE 211
Basic Computer Instructions
 Only 3 bits are used for operation code
 It may seem computer is restricted to eight different
operations
 however register reference and input output instructions use
remaining 12 bit as part of operation code
 so total number of instruction can exceed 8
Infact total no. of instructions chosen for basic computer is 25
Basic Computer Organization and Design 21
CSE 211
Basic Computer Instructions
AND 0xxx 8xxx AND memory word to AC
ADD 1xxx 9xxx Add memory word to AC
LDA 2xxx Axxx Load AC from memory
STA 3xxx Bxxx Store content of AC into memory
BUN 4xxx Cxxx Branch unconditionally
BSA 5xxx Dxxx Branch and save return address
ISZ 6xxx Exxx Increment and skip if zero
CLA 7800 Clear AC
CLE 7400 Clear E
CMA 7200 Complement AC
CME 7100 Complement E
CIR 7080 Circulate right AC and E
CIL 7040 Circulate left AC and E
INC 7020 Increment AC
SPA 7010 Skip next instr. if AC is positive
SNA 7008 Skip next instr. if AC is negative
SZA 7004 Skip next instr. if AC is zero
SZE 7002 Skip next instr. if E is zero
HLT 7001 Halt computer
INP F800 Input character to AC
OUT F400 Output character from AC
SKI F200 Skip on input flag
SKO F100 Skip on output flag
ION F080 Interrupt on
IOF F040 Interrupt off
Hex Code
Symbol I = 0 I = 1 Description
Basic Computer Organization and Design 22
CSE 211
Instruction Set Completeness
The set of instructions are said to be complete if computer includes a
sufficient number of instruction in each of the following categories :
A computer should have a set of instructions so that the user can
construct machine language programs to evaluate any function that is
known to be computable.
 Functional Instructions
- Arithmetic, logic, and shift instructions
- ADD, CMA, INC, CIR, CIL, AND, CMA, CLA
Transfer Instructions
- Data transfers between the main memory and the processor registers
- LDA, STA
Control Instructions
- Program sequencing and control
- BUN, BSA, ISZ
Input/output Instructions
- Input and output
- INP, OUT
23

More Related Content

What's hot

Computer registers
Computer registersComputer registers
Computer registers
Jatin Grover
 
Computer organisation
Computer organisationComputer organisation
Computer organisationMohd Arif
 
Assembly Language
Assembly LanguageAssembly Language
Assembly Language
Vijay Kumar
 
N_Asm Assembly registers (sol)
N_Asm Assembly registers (sol)N_Asm Assembly registers (sol)
N_Asm Assembly registers (sol)
Selomon birhane
 
Addressing modes (detailed data path)
Addressing modes (detailed data path)Addressing modes (detailed data path)
Addressing modes (detailed data path)Mahesh Kumar Attri
 
MCA-I-COA- overview of register transfer, micro operations and basic computer...
MCA-I-COA- overview of register transfer, micro operations and basic computer...MCA-I-COA- overview of register transfer, micro operations and basic computer...
MCA-I-COA- overview of register transfer, micro operations and basic computer...
Rai University
 
Computer organization & architecture chapter-1
Computer organization & architecture chapter-1Computer organization & architecture chapter-1
Computer organization & architecture chapter-1
Shah Rukh Rayaz
 
Advanced micro -processor
Advanced micro -processorAdvanced micro -processor
Advanced micro -processor
Hinal Lunagariya
 
encoder.pptx
encoder.pptxencoder.pptx
encoder.pptx
Pradeep Kumar
 
Io processing
Io processingIo processing
Io processingTech_MX
 
Unit 5
Unit 5Unit 5
Unit 5
sowndaryaM5
 
Computer organization
Computer organization Computer organization
Computer organization
vishnu973656
 
Chapter 2
Chapter 2Chapter 2
8086 Interrupts & With DOS and BIOS by vijay
8086 Interrupts &  With DOS and BIOS  by vijay8086 Interrupts &  With DOS and BIOS  by vijay
8086 Interrupts & With DOS and BIOS by vijay
Vijay Kumar
 
Register & Memory
Register & MemoryRegister & Memory
Register & Memory
Education Front
 
Processor Basics
Processor BasicsProcessor Basics
Processor Basics
Education Front
 
I/O Channel IBM 370
I/O Channel IBM 370I/O Channel IBM 370
I/O Channel IBM 370
Äkshäý M S
 

What's hot (18)

Instruction codes
Instruction codesInstruction codes
Instruction codes
 
Computer registers
Computer registersComputer registers
Computer registers
 
Computer organisation
Computer organisationComputer organisation
Computer organisation
 
Assembly Language
Assembly LanguageAssembly Language
Assembly Language
 
N_Asm Assembly registers (sol)
N_Asm Assembly registers (sol)N_Asm Assembly registers (sol)
N_Asm Assembly registers (sol)
 
Addressing modes (detailed data path)
Addressing modes (detailed data path)Addressing modes (detailed data path)
Addressing modes (detailed data path)
 
MCA-I-COA- overview of register transfer, micro operations and basic computer...
MCA-I-COA- overview of register transfer, micro operations and basic computer...MCA-I-COA- overview of register transfer, micro operations and basic computer...
MCA-I-COA- overview of register transfer, micro operations and basic computer...
 
Computer organization & architecture chapter-1
Computer organization & architecture chapter-1Computer organization & architecture chapter-1
Computer organization & architecture chapter-1
 
Advanced micro -processor
Advanced micro -processorAdvanced micro -processor
Advanced micro -processor
 
encoder.pptx
encoder.pptxencoder.pptx
encoder.pptx
 
Io processing
Io processingIo processing
Io processing
 
Unit 5
Unit 5Unit 5
Unit 5
 
Computer organization
Computer organization Computer organization
Computer organization
 
Chapter 2
Chapter 2Chapter 2
Chapter 2
 
8086 Interrupts & With DOS and BIOS by vijay
8086 Interrupts &  With DOS and BIOS  by vijay8086 Interrupts &  With DOS and BIOS  by vijay
8086 Interrupts & With DOS and BIOS by vijay
 
Register & Memory
Register & MemoryRegister & Memory
Register & Memory
 
Processor Basics
Processor BasicsProcessor Basics
Processor Basics
 
I/O Channel IBM 370
I/O Channel IBM 370I/O Channel IBM 370
I/O Channel IBM 370
 

Similar to Instruction codes and computer registers

unit2 (1).ppt
unit2 (1).pptunit2 (1).ppt
unit2 (1).ppt
rajkb821112
 
Instruction codes and computer registers
Instruction codes and computer registersInstruction codes and computer registers
Instruction codes and computer registers
mahesh kumar prajapat
 
Computer Organization and Architecture.
Computer Organization and Architecture.Computer Organization and Architecture.
Computer Organization and Architecture.
CS_GDRCST
 
Ca basic computer organization
Ca basic computer organizationCa basic computer organization
Ca basic computer organization
Prof. Dr. K. Adisesha
 
Computer organiztion5
Computer organiztion5Computer organiztion5
Computer organiztion5Umang Gupta
 
BasicComputerOrganization and Architecture by Moriss Meno
BasicComputerOrganization and Architecture by Moriss MenoBasicComputerOrganization and Architecture by Moriss Meno
BasicComputerOrganization and Architecture by Moriss Meno
RNShukla7
 
BASIC COMPUTER ORGANIZATION AND DESIGN
BASIC  COMPUTER  ORGANIZATION  AND  DESIGNBASIC  COMPUTER  ORGANIZATION  AND  DESIGN
BASIC COMPUTER ORGANIZATION AND DESIGN
Dr. Ajay Kumar Singh
 
COA CHAPTER 5
COA CHAPTER 5COA CHAPTER 5
COA CHAPTER 5
Mori77
 
Ch5 official.ppt
Ch5 official.pptCh5 official.ppt
Ch5 official.ppt
AshokRachapalli1
 
Unit. 3 coa.ppt
Unit. 3 coa.pptUnit. 3 coa.ppt
Unit. 3 coa.ppt
AESHAMEHTA13
 
Unit_2 (4).pptx
Unit_2 (4).pptxUnit_2 (4).pptx
Unit_2 (4).pptx
AyushiBhatla
 
Chp 2 and 3.pptx
Chp 2 and 3.pptxChp 2 and 3.pptx
Chp 2 and 3.pptx
SangeetaTripathi8
 
CAAL_CCSU_U1.pdf
CAAL_CCSU_U1.pdfCAAL_CCSU_U1.pdf
CAAL_CCSU_U1.pdf
salabhmehrotra
 
The Basic Organization of Computers
The Basic Organization of ComputersThe Basic Organization of Computers
The Basic Organization of Computers
Tallat Satti
 
material for studentbasic computer organization and design .pptx
material for studentbasic computer organization and design .pptxmaterial for studentbasic computer organization and design .pptx
material for studentbasic computer organization and design .pptx
jainyshah20
 
computer organization.pdf
computer organization.pdfcomputer organization.pdf
computer organization.pdf
VishnupriyaKashyap
 
Ch5_MorrisMano.pptx
Ch5_MorrisMano.pptxCh5_MorrisMano.pptx
Ch5_MorrisMano.pptx
SangeetaTripathi8
 
cse211 power point presentation for engineering
cse211 power point presentation for engineeringcse211 power point presentation for engineering
cse211 power point presentation for engineering
VishnuVinay6
 
CS304PC:Computer Organization and Architecture Session 5 Basic Computer Orga...
CS304PC:Computer Organization and Architecture  Session 5 Basic Computer Orga...CS304PC:Computer Organization and Architecture  Session 5 Basic Computer Orga...
CS304PC:Computer Organization and Architecture Session 5 Basic Computer Orga...
Asst.prof M.Gokilavani
 

Similar to Instruction codes and computer registers (20)

unit2 (1).ppt
unit2 (1).pptunit2 (1).ppt
unit2 (1).ppt
 
Instruction codes and computer registers
Instruction codes and computer registersInstruction codes and computer registers
Instruction codes and computer registers
 
Computer Organization and Architecture.
Computer Organization and Architecture.Computer Organization and Architecture.
Computer Organization and Architecture.
 
Ca basic computer organization
Ca basic computer organizationCa basic computer organization
Ca basic computer organization
 
Computer organiztion5
Computer organiztion5Computer organiztion5
Computer organiztion5
 
BasicComputerOrganization and Architecture by Moriss Meno
BasicComputerOrganization and Architecture by Moriss MenoBasicComputerOrganization and Architecture by Moriss Meno
BasicComputerOrganization and Architecture by Moriss Meno
 
BASIC COMPUTER ORGANIZATION AND DESIGN
BASIC  COMPUTER  ORGANIZATION  AND  DESIGNBASIC  COMPUTER  ORGANIZATION  AND  DESIGN
BASIC COMPUTER ORGANIZATION AND DESIGN
 
COA CHAPTER 5
COA CHAPTER 5COA CHAPTER 5
COA CHAPTER 5
 
Ch5 official.ppt
Ch5 official.pptCh5 official.ppt
Ch5 official.ppt
 
Unit. 3 coa.ppt
Unit. 3 coa.pptUnit. 3 coa.ppt
Unit. 3 coa.ppt
 
Unit_2 (4).pptx
Unit_2 (4).pptxUnit_2 (4).pptx
Unit_2 (4).pptx
 
Chp 2 and 3.pptx
Chp 2 and 3.pptxChp 2 and 3.pptx
Chp 2 and 3.pptx
 
CAAL_CCSU_U1.pdf
CAAL_CCSU_U1.pdfCAAL_CCSU_U1.pdf
CAAL_CCSU_U1.pdf
 
Lecture 11
Lecture 11Lecture 11
Lecture 11
 
The Basic Organization of Computers
The Basic Organization of ComputersThe Basic Organization of Computers
The Basic Organization of Computers
 
material for studentbasic computer organization and design .pptx
material for studentbasic computer organization and design .pptxmaterial for studentbasic computer organization and design .pptx
material for studentbasic computer organization and design .pptx
 
computer organization.pdf
computer organization.pdfcomputer organization.pdf
computer organization.pdf
 
Ch5_MorrisMano.pptx
Ch5_MorrisMano.pptxCh5_MorrisMano.pptx
Ch5_MorrisMano.pptx
 
cse211 power point presentation for engineering
cse211 power point presentation for engineeringcse211 power point presentation for engineering
cse211 power point presentation for engineering
 
CS304PC:Computer Organization and Architecture Session 5 Basic Computer Orga...
CS304PC:Computer Organization and Architecture  Session 5 Basic Computer Orga...CS304PC:Computer Organization and Architecture  Session 5 Basic Computer Orga...
CS304PC:Computer Organization and Architecture Session 5 Basic Computer Orga...
 

More from mahesh kumar prajapat

Parallel processing and pipelining
Parallel processing and pipeliningParallel processing and pipelining
Parallel processing and pipelining
mahesh kumar prajapat
 
Control Memory
Control MemoryControl Memory
Control Memory
mahesh kumar prajapat
 
Register transfer and microoperations
Register transfer and microoperationsRegister transfer and microoperations
Register transfer and microoperations
mahesh kumar prajapat
 
Memory Reference instruction
Memory Reference instructionMemory Reference instruction
Memory Reference instruction
mahesh kumar prajapat
 
Cpu unit
Cpu unitCpu unit
Multiprocessors
MultiprocessorsMultiprocessors
Multiprocessors
mahesh kumar prajapat
 
Peripheral devices
Peripheral devicesPeripheral devices
Peripheral devices
mahesh kumar prajapat
 
computer arithmatic
computer arithmaticcomputer arithmatic
computer arithmatic
mahesh kumar prajapat
 
Register Transfer Language
Register Transfer LanguageRegister Transfer Language
Register Transfer Language
mahesh kumar prajapat
 
Computer Organization and Design Chapter2
Computer Organization and Design Chapter2Computer Organization and Design Chapter2
Computer Organization and Design Chapter2
mahesh kumar prajapat
 
Arithmetic micro Operations
Arithmetic micro OperationsArithmetic micro Operations
Arithmetic micro Operations
mahesh kumar prajapat
 
Bus and Memory transfer
Bus and Memory transferBus and Memory transfer
Bus and Memory transfer
mahesh kumar prajapat
 
Logic Micro Operation
Logic Micro OperationLogic Micro Operation
Logic Micro Operation
mahesh kumar prajapat
 
Computer Organization and Design Chapter1
 Computer Organization and Design Chapter1 Computer Organization and Design Chapter1
Computer Organization and Design Chapter1
mahesh kumar prajapat
 

More from mahesh kumar prajapat (14)

Parallel processing and pipelining
Parallel processing and pipeliningParallel processing and pipelining
Parallel processing and pipelining
 
Control Memory
Control MemoryControl Memory
Control Memory
 
Register transfer and microoperations
Register transfer and microoperationsRegister transfer and microoperations
Register transfer and microoperations
 
Memory Reference instruction
Memory Reference instructionMemory Reference instruction
Memory Reference instruction
 
Cpu unit
Cpu unitCpu unit
Cpu unit
 
Multiprocessors
MultiprocessorsMultiprocessors
Multiprocessors
 
Peripheral devices
Peripheral devicesPeripheral devices
Peripheral devices
 
computer arithmatic
computer arithmaticcomputer arithmatic
computer arithmatic
 
Register Transfer Language
Register Transfer LanguageRegister Transfer Language
Register Transfer Language
 
Computer Organization and Design Chapter2
Computer Organization and Design Chapter2Computer Organization and Design Chapter2
Computer Organization and Design Chapter2
 
Arithmetic micro Operations
Arithmetic micro OperationsArithmetic micro Operations
Arithmetic micro Operations
 
Bus and Memory transfer
Bus and Memory transferBus and Memory transfer
Bus and Memory transfer
 
Logic Micro Operation
Logic Micro OperationLogic Micro Operation
Logic Micro Operation
 
Computer Organization and Design Chapter1
 Computer Organization and Design Chapter1 Computer Organization and Design Chapter1
Computer Organization and Design Chapter1
 

Recently uploaded

Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
AafreenAbuthahir2
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
ViniHema
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
Kamal Acharya
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
SupreethSP4
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
Pipe Restoration Solutions
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
ongomchris
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
Jayaprasanna4
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
BrazilAccount1
 

Recently uploaded (20)

Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
 

Instruction codes and computer registers

  • 1. 1 CSE211 Computer Organization and Design Lecture : 3 Tutorial: 1 Practical: 0 Credit: 4 Ritika Sharma (Asst. Professor, LPU)
  • 2. Basic Computer Organization and Design 2 CSE 211 Overview  Instruction Codes  Computer Registers  Computer Instructions  Timing and Control  Instruction Cycle  Memory Reference Instructions  Input-Output and Interrupt  Complete Computer Description
  • 3. Basic Computer Organization and Design 3 CSE 211 Introduction • Organization of computer is defined by its : • Internal Registers • Timing and Control Structure • Set of instructions that it uses • Every different processor type has its own design (different registers, buses, microoperations, machine instructions, etc) • Modern processor is a very complex device • It contains – Many registers – Multiple arithmetic units, for both integer and floating point calculations – The ability to pipeline several consecutive instructions to speed execution – Etc. • However, to understand how processors work, we will start with a simplified processor model
  • 4. Basic Computer Organization and Design 4 CSE 211 Basic Computer • The Basic Computer has two components, a processor and memory • The memory has 4096 words in it – 4096 = 212, so it takes 12 bits to select a word in memory • Each word is 16 bits long CPU RAM 0 4095 015
  • 5.  OpcodeAdd(110110) Code is decoded in CU Comp.issues control signals to read operand from mem.& add the operand to Processor register.
  • 6. Basic Computer Organization and Design 6 CSE 211 Instruction  Program  A sequence of (machine) instructions  Instruction  binary code that specifies a sequence of microoperations for a computer.  The instructions of a program, along with any needed data are stored in memory  The CPU reads the next instruction from memory  It is placed in an Instruction Register (IR)  Control circuitry in control unit then translates the instruction into the sequence of microoperations necessary to implement it
  • 7. Basic Computer Organization and Design 7 CSE 211 Instruction Format  Instruction Codes  A group of bits that tell the computer to perform a specific operation (a sequence of micro-operation)  A computer instruction is often divided into two parts  An opcode (Operation Code) that specifies the operation for that instruction  Sometimes called as Macrooperation  An address that specifies the registers and/or locations in memory to use for that operation  In the Basic Computer, the memory contains 4096 (= 212) words, we needs 12 bit to specify which memory address this instruction will use  In the Basic Computer, bit 15 of the instruction specifies the addressing mode (0: direct addressing, 1: indirect addressing)  Since the memory words, and hence the instructions, are 16 bits long, that leaves 3 bits for the instruction’s opcode
  • 8. Basic Computer Organization and Design 8 CSE 211 Instruction Format  Sometimes the address bit of instruction code represent various different information, classified into different Instruction formats :  Immediate Instruction : when second part of instruction specifies operand  When second part of address specify address :  Direct Addressing : second part of instruction specifies address of an operand  Indirect Addressing : second part of instruction designates an address of a memory in which the address of the operand is found Opcode Address Instruction Format 15 14 12 0 I 11 Addressing mode
  • 9. Basic Computer Organization and Design 9 CSE 211 Addressing Mode • The address field of an instruction can represent either – Direct address: the address in memory of the data to use (the address of the operand), or – Indirect address: the address in memory of the address in memory of the data to use • Effective Address (EA) – The address, that can be directly used without modification to access an operand for a computation-type instruction, or as the target address for a branch-type instruction 0 ADD 45722 Operand457 1 ADD 30035 1350300 Operand1350 + AC + AC Direct addressing Indirect addressing
  • 10. Basic Computer Organization and Design 10 CSE 211 Processor Register  A processor has many registers to hold instructions, addresses, data, etc  The processor has a register, the Program Counter (PC) that holds the memory address of the next instruction to be executed Since the memory in the Basic Computer only has 4096 locations, the PC only needs 12 bits  In a direct or indirect addressing, the processor needs to keep track of what locations in memory it is addressing: The Address Register (AR) is used for this The AR is a 12 bit register in the Basic Computer  When an operand is found, using either direct or indirect addressing, it is placed in the Data Register (DR). The processor then uses this value as data for its operation  The Basic Computer has a single general purpose register – the Accumulator (AC)
  • 11. Basic Computer Organisation and Design 11 CSE 211 Processor Register  The significance of a general purpose register is that it can be referred to in instructions e.g. load AC with the contents of a specific memory location; store the contents of AC into a specified memory location  Often a processor will need a scratch register to store intermediate results or other temporary data; in the Basic Computer this is the Temporary Register (TR)  The Basic Computer uses a very simple model of input/output (I/O) operations Input devices are considered to send 8 bits of character data to the processor The processor can send 8 bits of character data to output devices  The Input Register (INPR) holds an 8 bit character gotten from an input device  The Output Register (OUTR) holds an 8 bit character to be send to an output device
  • 12.
  • 13. Basic Computer Organization and Design 13 CSE 211 Processor Register List of BC Registers DR 16 Data Register Holds memory operand AR 12 Address Register Holds address for memory AC 16 Accumulator Processor register IR 16 Instruction Register Holds instruction code PC 12 Program Counter Holds address of instruction TR 16 Temporary Register Holds temporary data INPR 8 Input Register Holds input character OUTR 8 Output Register Holds output character Registers in the Basic Computer 11 0 PC 15 0 IR 15 0 TR 7 0 OUTR 15 0 DR 15 0 AC 11 0 AR INPR 0 7 Memory 4096 x 16 CPU
  • 14. Basic Computer Organization and Design 14 CSE 211 Common Bus System  Basic computer : 8 register, a memory unit and a control unit  The registers in the Basic Computer are connected using a bus  This gives a savings in circuitry over complete connections between registers  Output of 6 register and memory connected to input of bus  Specific output that is selected for bus lines will be determined by selection variables S2, S1, S0
  • 15. Basic Computer Organization and Design 15 CSE 211 Common Bus System S1 S0 Bus Memory unit 4096 x 16 LD INR CLR Address ReadWrite AR LD INR CLR PC LD INR CLR DR LD INR CLR ACALU E INPR IR LD LD INR CLR TR OUTR LD Clock 7 1 2 3 4 5 6 S2
  • 16. Basic Computer Organization and Design CSE 211 Common Bus System  Three control lines, S2, S1, and S0 control which register the bus selects as its input  Either one of the registers will have its load signal activated, or the memory will have its write signal activated Will determine where the data from the bus gets loaded  Memory places its 16 bit output on bus when read input is activated and S2S1S0=111 0 0 0 x 0 0 1 AR 0 1 0 PC 0 1 1 DR 1 0 0 AC 1 0 1 IR 1 1 0 TR 1 1 1 Memory S2 S1 S0 Register
  • 17. Basic Computer Organization and Design CSE 211 Common Bus System  4 register DR, AC, IR, TR is 16 bit. The 12-bit registers, AR and PC, have 0’s loaded onto the bus in the high order 4 bit positions  When the 8-bit register OUTR is loaded from the bus, the data comes from the low order 8 bits on the bus  INPR – connected to provide information to bus - receives character from input device and transfer to AC  OUTR – can only receive information from bus - receives a character from AC and delivers to Output device  Three types of input to AC :  from AC : complement AC, Shift AC  from DR : arithmetic and logic microoperation  from INPR
  • 18. Basic Computer Organization and Design CSE 211 Common Bus System  Bus lines connected to inputs of 6 registers and memory  Three types of input to AC :  from AC : complement AC, Shift AC  from DR : arithmetic and logic microoperation  from INPR  Input/output data connected to common bus but memory address connected to AR
  • 19. Basic Computer Organization and Design 19 CSE 211 Basic Computer Instructions Basic Computer Instruction Format 15 14 12 11 0 I Opcode Address 1. Memory-Reference Instructions (OP-code = 000 ~ 110) 2. Register-Reference Instructions (OP-code = 111, I = 0) 3. Input-Output Instructions (OP-code =111, I = 1) 15 12 11 0 Register operation0 1 1 1 15 12 11 0 I/O operation1 1 1 1
  • 20. Basic Computer Organization and Design 20 CSE 211 Basic Computer Instructions  Only 3 bits are used for operation code  It may seem computer is restricted to eight different operations  however register reference and input output instructions use remaining 12 bit as part of operation code  so total number of instruction can exceed 8 Infact total no. of instructions chosen for basic computer is 25
  • 21. Basic Computer Organization and Design 21 CSE 211 Basic Computer Instructions AND 0xxx 8xxx AND memory word to AC ADD 1xxx 9xxx Add memory word to AC LDA 2xxx Axxx Load AC from memory STA 3xxx Bxxx Store content of AC into memory BUN 4xxx Cxxx Branch unconditionally BSA 5xxx Dxxx Branch and save return address ISZ 6xxx Exxx Increment and skip if zero CLA 7800 Clear AC CLE 7400 Clear E CMA 7200 Complement AC CME 7100 Complement E CIR 7080 Circulate right AC and E CIL 7040 Circulate left AC and E INC 7020 Increment AC SPA 7010 Skip next instr. if AC is positive SNA 7008 Skip next instr. if AC is negative SZA 7004 Skip next instr. if AC is zero SZE 7002 Skip next instr. if E is zero HLT 7001 Halt computer INP F800 Input character to AC OUT F400 Output character from AC SKI F200 Skip on input flag SKO F100 Skip on output flag ION F080 Interrupt on IOF F040 Interrupt off Hex Code Symbol I = 0 I = 1 Description
  • 22. Basic Computer Organization and Design 22 CSE 211 Instruction Set Completeness The set of instructions are said to be complete if computer includes a sufficient number of instruction in each of the following categories : A computer should have a set of instructions so that the user can construct machine language programs to evaluate any function that is known to be computable.  Functional Instructions - Arithmetic, logic, and shift instructions - ADD, CMA, INC, CIR, CIL, AND, CMA, CLA Transfer Instructions - Data transfers between the main memory and the processor registers - LDA, STA Control Instructions - Program sequencing and control - BUN, BSA, ISZ Input/output Instructions - Input and output - INP, OUT
  • 23. 23