SlideShare a Scribd company logo
1 of 60
Overview of Register Transfer,
Micro Operations and Basic
Computer Organization and Design
Course: MCA-I
Subject: Computer Organization
And Architecture
Unit-2
1
Program And Instruction
• A computer organization involves combining everything
we have learned to date into a single integrated unit
– What is a computer?
• Von Neuman refers to a computer as a “stored program
digital computer”
– What is a program?
• What is an instruction?
• How are instructions executed?
Computer – High Level View
• CPU, Memory and Bus architectures with interface to I/O.
Input Output
Control Unit (CU)
Arithmetic and Logic
Unit
(ALU)
CPU
Volatile Memory (RAM)
M[0]
M[1]
M[K]
M[L-1]
CLK
Address Bus
Control
Bus
Data Bus
I/O Bus
Mano defines Memory as 4096 words.
This requires an Address bus of 12 bits
to act as selection inputs to
address/data multiplexers.
The fundamental unit of addressable
memory is the word. Each word is 16
bits long. The Data bus carries exactly
1 word of data between Memory and
CPU.
Input and Output is
defined using the ASCII
code of length 8 bits.
The Mano model of the CPU Registers
• CPU registers used in the model (Mano), categorized by length:
– PC :: Program counter (address – 12 bits)
– AR :: Address register (address – 12 bits)
– IR :: Instruction register (data – 16 bits)
– DR :: Data register (data – 16 bits)
– AC :: Accumulator (data – 16 bits)
– INR :: Input buffer register (ASCII data – 8 bits)
– OUTR :: Output buffer register (ASCII data – 8 bits)
– SCR :: Sequence counter register (4 bits)
– E, R :: Single bit flip-flops (flag/utility, interrupt)
CPU Register Lengths
• The register lengths (number of flip-flops to store bits) are determined by
number of memory locations (address space) and the bus width (in bits) that
determines the number of bits transferred between Memory and CPU, or
between I/O channels and CPU.
PC
AR
DR
IR
AC
INR
OUTR
SCR
12 bits
16 bits
8 bits
4 bits
1 bit
1 bit
E
R
Stored programs
• A stored program is a set of instructions and data
expressed in binary language, stored in non-volatile (ie.
disk storage) memory
• Programs can be executed only from Memory.
– Thus, a program must be loaded from disk to RAM in
order to execute it.
– Loaded programs are called processes.
– Individual instructions must be transferred to the CPU
where they are executed, using data that must be obtained
from either CPU registers or RAM
• A process is executed by executing each individual
instruction that, collectively, fulfill the intentions of the
programmer.
Instruction Architecture
• The list of all instructions engineered for a computer’s CPU
is called the instruction set.
• To distinguish each instruction, they are assigned a unique
numeric code
– Can be done in many ways
– Does not need to be ordinal (ie. starting from 0 and
running contiguously)
– Can be partially ordinal and partially hierarchical
• Mano’s approach
• Instructions must be capable of referencing Memory and/or
CPU addresses in order to cause data to be transferred and
operated on.
Instruction Architecture
• Instructions consist of
– Operation code data
– Address data
– Mode data
• Direct addressing – data found at the specified address
• Indirect addressing – data found at the address found at the
specified address (pointer concept)
I OpCode Address
15 14 12 11 0
IR
0
Mode
bit
1
The number of memory referenced operands varies from computer
to computer.
Mano simplifies the instruction architecture to permit zero or one
memory address field. In the case of Indirect addressing mode
there are two memory accesses, but only one reference.
Instruction Hierarchy
• It is desirable to engineer the computer to support
a reasonable number of independent instructions
– Examples:
• Add, subtract, transfer, shift, logic, comparison, branch,
input, output
– 4 bits can be used to support 24
= 16 unique
instructions
• Leaves 12 bits to represent an address space of 4096 words
– However, 16 instructions is not enough for most
program needs
I OpCode Address
15 14 12 11 0
IR
Instruction Hierarchy
• It is desirable to engineer the computer to support
a reasonable number of independent instructions
– Use a hierarchical scheme (1+3 scheme)
• OpCode – 3 bits – supports 8 unique codes
– 0-6 (instructions)
– 7 (toggle)
• Mode – 1 bit – supports 2 addressing modes
– I = 0 Direct addressing
– I = 1 Indirect addressing
• Special Case :: OpCode = 7 (toggle) PLUS Mode bit (I)
– Use 12 bits of Address field to specify additional instructions
I OpCode Address
15 14 12 11 0
IR
Instruction Hierarchy
• Mano’s instruction set consists of 25 instructions:
OpCode (0-6) OpCode (7)
Instruction
Direct (I=0) Indirect (I=1) Direct (I=0) Indirect (I=1)
4 bit code
0 AND
1 ADD
2 LDA
3 STA
4 BUN
5 BSA
6 ISZ
4 bit code
8 AND
9 ADD
A LDA
B STA
C BUN
D BSA
E ISZ
16 bit code
7800 CLA
7400 CLE
7200 CMA
7100 CME
7080 CIR
7040 CIL
7020 INC
7010 SPA
7008 SNA
7004 SZA
7002 SZE
16 bit code
F800 INP
F400 OUT
F200 SKI
F100 SKO
F080 ION
F040 IOF
7
6
12
Instruction Set Completeness
• Selection of instructions should span a
variety of applications suitable to
support programming
– Arithmetic, logical and shift
instructions
– Instructions for moving data to
and from memory and CPU
registers
– Program control instructions,
instructions that check status
conditions
– Input and Output instructions
• An important issue for many applications is
the number of programmable (general
purpose) registers.
• Mano adopts a minimalist approach
roviding a single such register, the
accumulator AC.
• This simple case does allow full illustration
of all computational requirements of a more
powerful computer with a larger instruction
set (but with much added cost to
programming).
• Among commercial computers one finds
both complex (large number) instruction
sets (CISC) and reduced (number)
instruction sets (RISC).
Instruction Processing & Instruction Cycle
• Instruction processing cannot occur in a single clock
cycle – it is too complicated !
– Must fetch the instruction from memory and load the
instruction register, IR.
– Must decode the Operation Code to determine whether data
must be fetched and whether we fetch data directly, or
indirectly
– Must fetch required data, if any, from memory into CPU
• OR, must store data from CPU into memory
• OR, must obtain data from Input
• OR, must place data for Output
– Must process the data according to instruction logic
• Thus, the instruction cycle consists of a controlled
sequence of microoperations
Timing and Control
• In order to control the steps of the instruction cycle,
it is necessary to introduce a counter, whose output is
used as input to the control logic
– We will utilize a Sequence Counter Register (SC, or SCR).
This is a register that holds a count value, can be reset to
zero and can be incremented (or decremented) by one
– Each instruction will require a specified number of time
steps to complete a sequence of microoperations. Each step
of the sequence is marked by a count value in SC.
SC
CLR
INC
……
Timing and Control
• The SC outputs a string of bits whose value is in the range from
0 to 2L
-1
– Eg. for L=3, from 0 to 7
• We need a way of converting the bit string value to single bit
valued outputs labelled T0, T1, T2, T3, and so on, up to Tx
(where x = 2L
-1)
• A decoder serves our purpose, recalling that the output from the
DEC is a 1 only on one line (the rest are 0`s)
SC
CLR
INC
……
L-to-2L
DEC
…
…..
Tx T2 T1 T0
Timing and Control
• Step 1: Where do we fetch the next instruction from
at T0 (start time)?
– The Program Counter register (PC) is assumed to hold the
address of the next instruction to be executed.
• It is loaded initially during the machine bootstrapping process.
– The PC is transferred to the Address Register (AR) which is
connected to the Address Bus Multiplexer.
• The AR provides the selection input to the address bus multiplexer to
enable RAM-CPU data transfers
T0 : AR = PC
PC
AR
Load
Timing and Control
• Step 2: How do we obtain the instruction from memory at T1?
– The data stored at the selected address is transferred onto the Data Bus and
then to the Data Register (DR) in the CPU.
– The instruction data is transferred immediately to the Instruction Register
(IR)
T1 : DR = M[AR] , IR = DR , PC = PC + 1
IR
PC
AR
Memory
Data bus
Address bus
CPU bus
DRM[AR]
INC
LD
LD
LD
Timing and Control
• Step 3: How do we decode the instruction intention (ie.
meaning, operational definition) at T2?
– The OpCode, Mode and Address field bits all serve as inputs
to the Control Logic Gates that select the specific instruction
semantics
• Direct addressing
• Indirect addressing
• CPU register addressing
• Input
• Output
T2 : {D0,...,D7} = DEC( IR(12-14) ),
AR = IR(0-11),
I = IR(15)
Note the reference to a
DECoder unit to explicitly
access the IR bits indicated
The AR may be directly
connected to the IR
address bits indicated
Timing and Control
• The instruction cycle consists of a controlled sequence of
microoperations using control logic gates and a sequence counter.
I OpCode Address
15 14 13 12 11 0IR
2 1 0
3x8 DEC
7 6 5 4 3 2 1 0
F E D C B A 9 ... 1 0
4x16 DEC
3 2 1 0
4-bit
Sequence
Counter (SC)
INC
CLR
Control
Logic
Gates Control
Outputs
Clock has
not been
included!
Enable one
specific logic
circuit
Signal the SC to
advance (INC) to
next timing
value, or reset.
Connect it all
together !
Timing inputs
An Architectural Basis for Programming
• Programs are written by humans and typically use high-level languages to
express logic.
– Programmers learn to use languages based on expressiveness and ease of
use
– Language designers are not limited by imagination in developing new
operations and techniques
– But, too much complexity presents real difficulties for practical,
widespread usage.
• Computer Instruction Sets are limited by the complexities of
– Working with materials on a micro- and nano-scale of fabrication
– Understanding of fundamental physics applied to signaling and
electromagnetic properties of matter
– Optimal design of complicated circuits with well-posed input/output logics
– Power efficiency issues, temperature control
– Performance and timing considerations
– Many other practical and theoretical objectives
An Architectural Basis for Programming
• Thus, Instruction Sets are minimal reflections (subduced
mappings) of high-level operation and function sets
– Limited number of hardware operations
• Assignment = Transfer
• Integer arithmetic (may include optimized floating point)
• Logic, Shift
• Non-sequential control (branching for decision and repetition)
• Input and Output
• Communications
• Specialized operations (string, array)
• Specialized addressing modes
• Enhanced data and register access modes
Instruction Categories
• Instructions may be placed in several different kinds of categories
– Conceptual application, or meaning
– Performance based on location of operation
• Studies of application programs have found that most programs perform best
when optimized for use of the CPU (called CPU intensive jobs)
• However, many programs must interact with peripheral devices that operate on
relatively slow electromechanical hardware (called I/O intensive jobs)
• Typically, programs are hybrids that must access I/O, memory and CPU in
various combinations and for different intervals of intensive use of a particular
resource.
• We adopt a performance based on location categorization of
instructions
– Register reference
– Memory reference
– I/O reference
– Within each category above we define conceptual subcategories
Register Reference Instructions
• Referencing CPU registers for data processing is the
fastest data access possible
– We consider two registers
• The Accumulator (AC)
– Used for arithmetic, logic and shift
– Also used for input and output
• The E-bit (E) utility flip-flop
– Used in shift operations
– May be used in arithmetic operations
AC
E
0 1 1 1 Operation control bits
15 14 12 11 0
IR
Register Reference Instructions
• The complete set of all instructions defined by Mano
– Mnemonic means a string that suggests the meaning.
Hex Mnemonic Binary coding Meaning
7800 CLA 0111100000000000 CLear Accumulator
7400 CLE 0111010000000000 CLear E
7200 CMA 0111001000000000 CoMplement Accumulator
7100 CME 0111000100000000 CoMplement E
7080 CIR 0111000010000000 CIrcular shift Right
7040 CIL 0111000001000000 CIrcular shift Left
7020 INC 0111000000100000 INCrement AC
7010 SPA 0111000000010000 Skip if Positive Accumulator
7008 SNA 0111000000001000 Skip if Negative Accumulator
7004 SZA 0111000000000100 Skip if Zero Accumulator
7002 SZE 0111000000000010 Skip if Zero E
7001 HLT 0111000000000001 HaLT the computer
Register Reference Instructions
• Within this instruction subset, one may find it
convenient to group the instructions by which register is
affected
Hex Mnemonic
7800 CLA
7200 CMA
7080 CIR
7040 CIL
7020 INC
7010 SPA
7008 SNA
7004 SZA
7400 CLE
7100 CME
7002 SZE
7001 HLT
AC affected
E affected
Control affected
Register Reference Instructions
• Clear, Complement or Increment : AC register.
• Clear, Complement : E register
Hex Mnemonic RTL
7800 CLA AC = 0
7200 CMA AC = ~ AC
7020 INC AC = AC + 1
Hex Mnemonic RTL
7400 CLE E = 0
7100 CME E = ~ E
AC
CLA
CMA
INC
E
CLE
CME
Register Reference Instructions
• Shift AC register.
– This is a circular shift that is performed using the E register
– Control over timing ensures all operations operate in parallel
• Eg. Use master-slave flip-flops in registers
Hex Mnemonic RTL
7080 CIR AC(0-14) = AC(1-15),
AC(15) = E, E = AC(0)
7040 CIL AC(1-15) = AC(0-14),
AC(0) = E, E = AC(15)
AC
E
Register Reference Instructions
• Skip on <condition> : AC register.
– Tests sign/value status of 2’s complement integer in AC
– If status matches query, advance PC by one instruction word
• Skip on Zero condition : E register
– Test status of E bit. If not zero, proceed to the next instruction.
– If zero, advance PC by one instruction word (recall that it has
already been incremented by one, so this causes skipping the next
instruction in contiguous sequence.
Hex Mnemonic RTL
7002 SZE ~ E : PC = PC + 1
Hex Mnemonic RTL
7010 SPA ( AC > 0 ) : PC = PC + 1
7008 SNA ( AC < 0 ) : PC = PC + 1
7004 SZA ( AC = 0 ) : PC = PC + 1
Register Reference Instructions
• Halting the computer
– Disable all circuits (over-ride all specific Enable controls with a
general Disable).
• Bootstrapping the computer
– “Turning on” the computer simply refers to supplying electricity to the
circuits and to the clock
– Since no instruction may be fetched to IR for execution unless a RAM
address is specified for the instruction, it is necessary to explicitly load
the PC with an initial instruction address.
– The textbook does not discuss this matter very much. To state it
briefly, a special memory called a ROM (a non-volatile memory
device) contains a sequence of instructions that loads an operating
system program, from disk into memory, and with the PC set to an
initial instruction address.
Hex Mnemonic RTL
7001 HLT Disable all circuits
Memory Reference Instructions
• Once an instruction has been loaded to IR, it may require further
access to memory to perform its intended function
– Direct Access – access the storage at the specified IR address
– Indirect Access – first, transfer to DR the data stored at the
specified IR address, then (after
transferring DR to AR), access
this fetched address to perform
the required function.
Operation Codes
Direct Indirect
I=0 I=1 Mnemonic
0 8 AND
1 9 ADD
2 A LDA
3 B STA
4 C BUN
5 D BSA
6 E ISZ
I OpCode Memory Address
15 14 12 11 0
IR
Memory Reference Instructions
• Direct access mode (I=0) operation semantics
Operation Codes
Direct
I=0 Mnemonic RTL
0 AND DR = M[AR] ; AC = AC ^ DR
1 ADD DR = M[AR] ; AC = AC + DR
2 LDA DR = M[AR] ; AC = DR
3 STA DR = AC ; M[AR] = DR
4 BUN AR = IR(0-11) ;
PC = AR
5 BSA AR = IR(0-11) ;
M[AR] = PC , PC = AR + 1
6 ISZ AR = IR(0-11) ; DR = M[AR] ;
AC = DR ; AC = AC + 1 ; DR = AC ;
M[AR] = DR , (AC=0) : PC = PC + 1
The actual number of timing steps (Tk) may vary
from 1 to 2 (or even 3) steps, depending on how the
control timing circuits are designed.
Memory Reference Instructions
• Indirect access mode (I=1) operation semantics using
AND and ADD
– First, fetch the pointer (address) data from memory to
obtain the indirect reference
– Second, fetch the needed data from the just-fetched address
Operation Codes
Indirect
I=1 Mnemonic RTL
8 AND AR = IR(0-11) ; DR = M[AR]
AR = DR(0-11) ; DR = M[AR]
AC = AC ^ DR
9 ADD AR = IR(0-11) ; DR = M[AR]
AR = DR(0-11) ; DR = M[AR]
AC = AC + DR
The actual number of timing steps (Tk) may vary
from 2 to 3 steps, depending on how the control
timing circuits are designed.
Memory Reference Instructions
• Transfer instructions
– Copy data to or from memory and CPU
• Loading (fetching) refers to memory-to-CPU transfers
• Storing refers to CPU-to-memory transfers
Operation Codes
Direct Indirect
I=0 I=1 Mnemonic RTL
2 A LDA DR = M[AR] ; AC = DR
3 B STA DR = AC ; M[AR] = DR
M
DR
AR
AC
Address
MUX
Data
bus
Memory Reference Instructions
• ADDition, Logical AND instructions
– Logical AND is done on all bits in parallel
– Numeric (2’s complement) addition may be done in serial,
or in parallel using Look-Ahead circuits
Operation Codes
Direct Indirect
I=0 I=1 Mnemonic RTL
0 8 AND DR = M[AR] ; AC = AC ^ DR
1 9 ADD DR = M[AR] ; AC = AC + DR
M
DR
AR
AC
Address
MUX
Data
bus
ADD/AND Logic
Memory Reference Instructions
• Branching
– Instructions that explicitly modify the PC during execution
– This implies that the next instruction to be executed is not located in
the next contiguous word of storage.
– Used to program IF-THEN-ELSE (Decision control) and WHILE-DO
(Repetition control) constructs in high-level languages.
PC
M
Current instr.
Next instr.
(a) BEFORE COMPLETION OF
EXECUTION (after DECoding)
PC
M
Current instr.
Next instr.
(b) AFTER COMPLETION
OF EXECUTION
This is called a
Branch Point
Address
Memory Reference Instructions
• Timing and control logic must be carefully worked out for all
steps in the instruction.
– For example, using the AND instruction:
– Note how the Direct and Indirect forms of the instruction are
differentiated using the I (or I’) bit value for control differentiation.
T0: AR = PC, SC = SC + 1
T1: IR = M[AR], PC = PC +1, SC = SC +1
T2: {D0..D7} = DEC(IR(12..14)), AR = IR(0..11), I = IR(15), SC = SC+1
D0.T3: DR = M[AR], SC = SC+1
I’.D0.T4: AC = AC^DR, SC = 0
I.D0.T4: AR = DR(0..11), SC = SC+1
I.D0.T5: DR = M[AR], SC = SC+1
I.D0.T6: AC = AC^DR, SC = 0
Memory Reference Instructions
• Branch UNconditional instruction
– I = 0 :: Replace PC by address in IR(0-11)
– I = 1 :: Replace PC by the address found at the address in IR(0-11)
• That is :: PC = M[ M[ IR(0-11) ] ]
Operation Codes
Direct Indirect
I=0 I=1 Mnemonic RTL
4 C BUN AR = IR(0-11)
PC = AR
M
DR
AR
P
C
Address
MUX
Data
bus
IR
I=1 I=0
Memory Reference Instructions
• Branch and SAve instruction
– Used for programming subroutine calls
Operation Codes
Direct Indirect
I=0 I=1 Mnemonic RTL
5 D BSA AR = IR(0-11)
M[AR] = PC , PC = AR + 1
PC
M
Subr. call instr.
Subr. entry instr.
(a) BEFORE SUBROUTINE CALL
PC
M
Return addr.
Subr. call instr.
Subr. entry instr.
(b) AFTER SUBROUTINE CALL
Memory Reference Instructions
• Increment and Skip if Zero instruction
– Used to implement a counter based <do-while> construct
I=0 I=1 Mnemonic RTL
6 E ISZ AR = IR(0-11) , DR = M[AR]
AC = DR , AC = AC + 1 , DR = AC
M[AR] = DR , (AC=0) : PC = PC + 1
PC
M
Data value
Current instr.
Branch instr.
Continue instr.
(a) BEFORE (b) AFTER
PC
M
Data value + 1
Current instr.
Branch instr.
Continue instr.
< 0
= 0
AR AR
Input/Output Instructions
• Used for communicating data between CPU and I/O
peripheral devices
• Also, need instructions to support programmed polling.
– Polling refers to waiting for a condition to be true before proceeding
16 bit
OpCode Mnemonic Meaning
F800 INP Input ASCII char
F400 OUT Output ASCII char
F200 SKI Skip if input flag (FGI=1)
F100 SKO Skip if output flag (FGO=1)
1 1 1 1 I/O operation control bits
15 14 12 11 0
IR
F 8
4
2
1
Input/Output Instructions
• Each peripheral device has a communications and control
interface that interacts with the computer’s interface logic circuits
– Input
• Need a data buffer (INPR) and a flag (FGI) indicating buffer empty/full
– Output
• Need a data buffer (OUTR) and a flag (FGO) indicating buffer empty/full
OUTR
FGO
Data
Status
Receiver
Interface
Printer
Keyboard Transmitter
Interface
PERIPHERAL DEVICES CPU
INPR
AC(H) AC(L)
FGI
Data
Status
NOTE:
Only the low order part
of AC is used.
Interrupts
• Input and Output interactions with electromechanical peripheral
devices require huge processing times compared with CPU
processing times
– I/O (milliseconds) versus CPU (nano/micro-seconds)
• Interrupts permit other CPU instructions to execute while waiting
for I/O to complete
– Need an additional 1-bit IEN flip-flop to store the interrupt status (0/1)
16 bit
OpCode Mnemonic Meaning
F080 ION Interrupt Enabled (IEN  1)
F040 IOF Interrupt Disabled (IEN  0)
1 1 1 1 I/O operation control bits
15 14 12 11 0
IR
IEN
Interrupts
• In this approach, interrupts are used only with I/O handling
– In addition to a flip-flop to store the Interrupt Enable state, one more
flip-flop (R) is needed to store the I/O Status (Ready/Not_ready).
– In general, interrupts may be used with arbitrary instructions for
exception trapping and handling
RR  1
=1
=1
IENIEN
FGI
FG0
FGI
FGO
Control Bus
=1
=0
=0
=0
All of these
flipflops are
assumed to be
reset to 0 when
bootstrapping the
computer.
1-bit registers
We will also
require one final
register, called TR
(for transfer). This
can be 16 bits, but
must be at least 12
bits.
Interrupt Handling Flowchart
R
IEN
FGI
FGO
Store return address
in location 0
M[0]  PC
Branch to location 1
PC  1
Reset Interrupt, Ready
IEN  0
R  0
=1 Interrupt Cycle
R  1
=1
=1
IEN
FGI
FG0
Control Bus
=1
=0
=0
=0
Fetch/Decode Instruction
Execute
Instruction
R
=0Instruction Cycle
TR
Interrupt Handling Flowchart
Store return address
in location 0
M[0]  PC
Branch to location 1
PC  1
Reset Interrupt, Ready
IEN  0
R  0
=1
Interrupt Cycle
R
Main Prog.
Curr Instr.
Next Instr.
0 BUN 1120
I/O Program
1 BUN 0
255
PC=256
0
1
1120
Memory
(a) BEFORE
Main Prog.
Curr Instr.
Next Instr.
256
0 BUN 1120
I/O Program
1 BUN 0
255
256
0
PC=1
1120
Memory
(b) AFTER
Interrupt
R T0 : AR  0 , TR  PC  NOTE TRANSFER REG.
R T1 : M[AR]  TR , PC  0
R T2 : PC  PC + 1 , IEN  0 , R  0 , SC  0
Control Logic
• Timing of microoperations requires explicit enabling of
logic circuits through the Control Unit logic gates
Timing and Control - Revisited
• The instruction cycle consists of a controlled sequence of
microoperations using control logic gates and a sequence counter.
I OpCode Address
15 14 13 12 11 0IR
2 1 0
3x8 DEC
7 6 5 4 3 2 1 0
F E D C B A 9 ... 1 0
4x16 DEC
3 2 1 0
4-bit
Sequence
Counter (SC)
INC
CLR
Control
Logic
Gates Control
Outputs
Control Logic
• Timing of microoperations requires explicit enabling of
logic circuits through the Control Unit logic gates
• Need signals …
– to control the inputs of the 9 registers
– to control the read and write inputs of memory
– to set, clear or complement the flip-flops
– for Selector inputs to select a register for the bus
– to control the AC adder, logic and shift circuit
Control Logic – Example: AR
• Consider all instructions that modify the AR register
• Construct an AR control circuit
Condition Microoperation
R’ T0 : AR  PC
R’ T2 : AR  IR(0-11)
D7’ I T3 : AR  M[AR]
R T0 : AR  0
D5 T4 : AR  AR + 1
AR
To From
Bus Bus
Clk
D7’
I
T3
T2
R
T0
D5
T4
LD
IN
C
CL
R
Control Logic
• In previous lectures we discussed complex register
circuits
– Control was exerted through enabling inputs
• The textbook provides additional examples of
controlling logic circuits
– Control of single flip-flops
– Control of common bus
• All registers can be adapted to controls
• Indeed, all computer circuits can be adapted to controls
– Using enable inputs
– Using control circuits
– Using counters, and so on.
Representing a Complete Architecture
• Small Scale Integration
– Logic Gates
– Simple Circuits – Combinational & Sequential
• Medium Scale Integration
– Functional Circuits and Control Logic
– Arithmetic, Logic, Shift, Comparison
– Decoders
– Multiplexers
• Large Scale Integration
– CPU
• Instruction set – Arithmetic & Logic Unit Subsystem
• Control logic – Control Unit Subsystem
• Registers
– Memory
• Memory storage cells
• Address, Data and Control Bus structure
– Input-Output
• Buffer registers, Control
Representing a Complete Architecture
• Hardware
– CPU
• Instruction set – Arithmetic & Logic Unit Subsystem
• Control logic – Control Unit Subsystem
• Registers
– Memory
• Memory storage cells
• Address, Data and Control Bus structure
– Input-Output, Bus Network
• Buses, Buffer registers, Control
Memory
4096 words
16 bits/word
CPU
9 Registers
- AR, PC, DR, AC, IR, TR, OUTR, INPR, SC
7 Flip-flops
- I, S, E, R, IEN, FGI, FGO
2 Decoders
- 3x8 Operation DEC, 4x16 Timing DEC
Control logic, ALU circuits
Buses
Address
Data
Control
Buffer connections
Hardware Components of BC
A memory unit: 4096 x 16.
Registers:
AR, PC, DR, AC, IR, TR, OUTR, INPR, and SC
Flip-Flops(Status):
I, S, E, R, IEN, FGI, and FGO
Decoders: a 3x8 Opcode decoder
a 4x16 timing decoder
Common bus: 16 bits
Control logic gates:
Adder and Logic circuit: Connected to ACControl Logic Gates
- Input Controls of the nine registers
- Read and Write Controls of memory
- Set, Clear, or Complement Controls of the flip-flops
- S2, S1, S0 Controls to select a register for the bus
- AC, and Adder and Logic circuit
CONTROL OF REGISTERS AND MEMORY
Scan all of the register transfer statements that change the content of AR:
LD(AR) = R'T0 + R'T2 + D'7IT3
CLR(AR) = RT0
INR(AR) = D5T4
Address Register; AR
R’T0: AR ← PC LD(AR)
R’T2: AR ← IR(0-11) LD(AR)
D’7IT3: AR ← M[AR] LD(AR)
RT0: AR ← 0 CLR(AR)
D5T4: AR ← AR + 1 INR(AR)
AR
LD
INR
CLR
Clock
To bus
12
From bus
12
D'
I
T
T
R
T
D
T
7
3
2
0
4
CONTROL OF FLAGS
pB7: IEN  1 (I/O Instruction)
pB6: IEN  0 (I/O Instruction)
RT2: IEN  0 (Interrupt)
p = D7IT3 (Input/Output Instruction)
IEN: Interrupt Enable Flag
D
I
T3
7
J
K
Q IEN
p
B7
B6
T2
R
CONTROL OF COMMON BUS
For AR D4T4: PC  AR
D5T5: PC  AR
x1 = D4T4 + D5T5
x1
x2
x3
x4
x5
x6
x7
Encoder
S 2
S 1
S 0
Multiplexer
bus select
inputs
x1 x2 x3 x4 x5 x6 x7 S2 S1 S0
selected
register
0 0 0 0 0 0 0 0 0 0 none
1 0 0 0 0 0 0 0 0 1 AR
0 1 0 0 0 0 0 0 1 0 PC
0 0 1 0 0 0 0 0 1 1 DR
0 0 0 1 0 0 0 1 0 0 AC
0 0 0 0 1 0 0 1 0 1 IR
0 0 0 0 0 1 0 1 1 0 TR
0 0 0 0 0 0 1 1 1 1 Memory
DESIGN OF
ACCUMULATOR LOGICCircuits associated with AC
All the statements that change the content of AC
16
16
8
Adder and
logic
circuit
16
ACFrom DR
From INPR
Control
gates
LD INR CLR
16
To bus
Clock
D0T5: AC  AC ∧ DR AND with DR
D1T5: AC  AC + DR Add with DR
D2T5: AC  DR Transfer from DR
pB11: AC(0-7)  INPR Transfer from INPR
rB9: AC  AC′ Complement
rB7 : AC  shr AC, AC(15)  E Shift right
rB6 : AC  shl AC, AC(0)  E Shift left
rB11 : AC  0 Clear
rB5 : AC  AC + 1 Increment
CONTROL OF AC
REGISTER
Gate structures for controlling
the LD, INR, and CLR of AC
AC
LD
INR
CLR
Clock
To bus16From Adder
and Logic
16
AND
ADD
DR
INPR
COM
SHR
SHL
INC
CLR
D0
D1
D2
B11
B9
B7
B6
B5
B11
r
p
T5
T5
ALU (ADDER AND LOGIC
CIRCUIT)
One stage of Adder and Logic circuit
AND
ADD
DR
INPR
COM
SHR
SHL
J
K
Q
AC(i)
LD
FA
C
C
From
INPR
bit(i)
DR(i)
AC(i)
AC(i+1)
AC(i-1)
i
i
i+1
I
Reference
Reference Book
• Computer Organization & Architecture 7e By
Stallings
• Computer System Architecture By Mano

More Related Content

What's hot

Types of Instruction Format
Types of Instruction FormatTypes of Instruction Format
Types of Instruction FormatDhrumil Panchal
 
Input Output Organization
Input Output OrganizationInput Output Organization
Input Output OrganizationKamal Acharya
 
8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS
8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS
8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONSRamaPrabha24
 
INTRODUCTION TO MICROCONTROLLER
INTRODUCTION TO MICROCONTROLLERINTRODUCTION TO MICROCONTROLLER
INTRODUCTION TO MICROCONTROLLERAnkita Jaiswal
 
Instruction Set Architecture
Instruction Set ArchitectureInstruction Set Architecture
Instruction Set ArchitectureDilum Bandara
 
Computer organization and architecture
Computer organization and architectureComputer organization and architecture
Computer organization and architectureSubesh Kumar Yadav
 
Computer architecture addressing modes and formats
Computer architecture addressing modes and formatsComputer architecture addressing modes and formats
Computer architecture addressing modes and formatsMazin Alwaaly
 
Microcontroller 8051 and its interfacing
Microcontroller 8051 and its interfacingMicrocontroller 8051 and its interfacing
Microcontroller 8051 and its interfacingAnkur Mahajan
 
Introduction to Digital Signal processors
Introduction to Digital Signal processorsIntroduction to Digital Signal processors
Introduction to Digital Signal processorsPeriyanayagiS
 
Interfacing adc
Interfacing adcInterfacing adc
Interfacing adcPRADEEP
 

What's hot (20)

Ch3
Ch3Ch3
Ch3
 
Control Memory
Control MemoryControl Memory
Control Memory
 
Types of Instruction Format
Types of Instruction FormatTypes of Instruction Format
Types of Instruction Format
 
Input Output Organization
Input Output OrganizationInput Output Organization
Input Output Organization
 
8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS
8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS
8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS
 
INTRODUCTION TO MICROCONTROLLER
INTRODUCTION TO MICROCONTROLLERINTRODUCTION TO MICROCONTROLLER
INTRODUCTION TO MICROCONTROLLER
 
Instruction Set Architecture
Instruction Set ArchitectureInstruction Set Architecture
Instruction Set Architecture
 
8255 ppi
8255 ppi8255 ppi
8255 ppi
 
06. thumb instructions
06. thumb instructions06. thumb instructions
06. thumb instructions
 
Interrupts
InterruptsInterrupts
Interrupts
 
Computer organization and architecture
Computer organization and architectureComputer organization and architecture
Computer organization and architecture
 
Computer architecture addressing modes and formats
Computer architecture addressing modes and formatsComputer architecture addressing modes and formats
Computer architecture addressing modes and formats
 
Modes of transfer
Modes of transferModes of transfer
Modes of transfer
 
Microcontroller 8051 and its interfacing
Microcontroller 8051 and its interfacingMicrocontroller 8051 and its interfacing
Microcontroller 8051 and its interfacing
 
Introduction to Digital Signal processors
Introduction to Digital Signal processorsIntroduction to Digital Signal processors
Introduction to Digital Signal processors
 
DATA REPRESENTATION
DATA  REPRESENTATIONDATA  REPRESENTATION
DATA REPRESENTATION
 
Serial data transfer
Serial data transferSerial data transfer
Serial data transfer
 
Interfacing adc
Interfacing adcInterfacing adc
Interfacing adc
 
Pentium processor
Pentium processorPentium processor
Pentium processor
 
Instruction cycle
Instruction cycleInstruction cycle
Instruction cycle
 

Similar to MCA-I-COA- overview of register transfer, micro operations and basic computer organization and design

B.sc cs-ii-u-2.2-overview of register transfer, micro operations and basic co...
B.sc cs-ii-u-2.2-overview of register transfer, micro operations and basic co...B.sc cs-ii-u-2.2-overview of register transfer, micro operations and basic co...
B.sc cs-ii-u-2.2-overview of register transfer, micro operations and basic co...Rai University
 
Bca 2nd sem-u-2.2-overview of register transfer, micro operations and basic c...
Bca 2nd sem-u-2.2-overview of register transfer, micro operations and basic c...Bca 2nd sem-u-2.2-overview of register transfer, micro operations and basic c...
Bca 2nd sem-u-2.2-overview of register transfer, micro operations and basic c...Rai University
 
Unit 1 computer architecture (1)
Unit 1   computer architecture (1)Unit 1   computer architecture (1)
Unit 1 computer architecture (1)DevaKumari Vijay
 
Computer Organization & Architecture (COA) Unit 2
Computer Organization & Architecture (COA) Unit 2Computer Organization & Architecture (COA) Unit 2
Computer Organization & Architecture (COA) Unit 2parthivrathodlits
 
Computer Organisation & Architecture (chapter 1)
Computer Organisation & Architecture (chapter 1) Computer Organisation & Architecture (chapter 1)
Computer Organisation & Architecture (chapter 1) Subhasis Dash
 
Computer Organization and Architechuture basics
Computer Organization and Architechuture basicsComputer Organization and Architechuture basics
Computer Organization and Architechuture basicsLucky Sithole
 
CO Unit 3.pdf (Important chapter of coa)
CO Unit 3.pdf (Important chapter of coa)CO Unit 3.pdf (Important chapter of coa)
CO Unit 3.pdf (Important chapter of coa)guptakrishns23
 
Introduction to Computer Architecture and Organization
Introduction to Computer Architecture and OrganizationIntroduction to Computer Architecture and Organization
Introduction to Computer Architecture and OrganizationDr. Balaji Ganesh Rajagopal
 
Computer Organization and Design.pptx
Computer Organization and Design.pptxComputer Organization and Design.pptx
Computer Organization and Design.pptxSherinRappai
 
introduction to embedded systems part 1
introduction to embedded systems part 1introduction to embedded systems part 1
introduction to embedded systems part 1Hatem Abd El-Salam
 
Computer Organization : CPU, Memory and I/O organization
Computer Organization : CPU, Memory and I/O organizationComputer Organization : CPU, Memory and I/O organization
Computer Organization : CPU, Memory and I/O organizationAmrutaMehata
 
Basic computer organization and design
Basic computer organization and designBasic computer organization and design
Basic computer organization and designmahesh kumar prajapat
 
BASIC COMPUTER ORGANIZATION AND DESIGN
BASIC  COMPUTER  ORGANIZATION  AND  DESIGNBASIC  COMPUTER  ORGANIZATION  AND  DESIGN
BASIC COMPUTER ORGANIZATION AND DESIGNDr. Ajay Kumar Singh
 
Introduction to Processor Design and ARM Processor
Introduction to Processor Design and ARM ProcessorIntroduction to Processor Design and ARM Processor
Introduction to Processor Design and ARM ProcessorDarling Jemima
 

Similar to MCA-I-COA- overview of register transfer, micro operations and basic computer organization and design (20)

B.sc cs-ii-u-2.2-overview of register transfer, micro operations and basic co...
B.sc cs-ii-u-2.2-overview of register transfer, micro operations and basic co...B.sc cs-ii-u-2.2-overview of register transfer, micro operations and basic co...
B.sc cs-ii-u-2.2-overview of register transfer, micro operations and basic co...
 
Bca 2nd sem-u-2.2-overview of register transfer, micro operations and basic c...
Bca 2nd sem-u-2.2-overview of register transfer, micro operations and basic c...Bca 2nd sem-u-2.2-overview of register transfer, micro operations and basic c...
Bca 2nd sem-u-2.2-overview of register transfer, micro operations and basic c...
 
Unit 1 computer architecture (1)
Unit 1   computer architecture (1)Unit 1   computer architecture (1)
Unit 1 computer architecture (1)
 
CAO.pptx
CAO.pptxCAO.pptx
CAO.pptx
 
Computer Organization & Architecture (COA) Unit 2
Computer Organization & Architecture (COA) Unit 2Computer Organization & Architecture (COA) Unit 2
Computer Organization & Architecture (COA) Unit 2
 
instruction format.pptx
instruction format.pptxinstruction format.pptx
instruction format.pptx
 
Computer Organisation & Architecture (chapter 1)
Computer Organisation & Architecture (chapter 1) Computer Organisation & Architecture (chapter 1)
Computer Organisation & Architecture (chapter 1)
 
Computer Organization and Architechuture basics
Computer Organization and Architechuture basicsComputer Organization and Architechuture basics
Computer Organization and Architechuture basics
 
Chp 2 and 3.pptx
Chp 2 and 3.pptxChp 2 and 3.pptx
Chp 2 and 3.pptx
 
CPU.ppd
CPU.ppdCPU.ppd
CPU.ppd
 
CO Unit 3.pdf (Important chapter of coa)
CO Unit 3.pdf (Important chapter of coa)CO Unit 3.pdf (Important chapter of coa)
CO Unit 3.pdf (Important chapter of coa)
 
Introduction to Computer Architecture and Organization
Introduction to Computer Architecture and OrganizationIntroduction to Computer Architecture and Organization
Introduction to Computer Architecture and Organization
 
Computer Organization and Design.pptx
Computer Organization and Design.pptxComputer Organization and Design.pptx
Computer Organization and Design.pptx
 
introduction to embedded systems part 1
introduction to embedded systems part 1introduction to embedded systems part 1
introduction to embedded systems part 1
 
Ch5_MorrisMano.pptx
Ch5_MorrisMano.pptxCh5_MorrisMano.pptx
Ch5_MorrisMano.pptx
 
Computer Organization : CPU, Memory and I/O organization
Computer Organization : CPU, Memory and I/O organizationComputer Organization : CPU, Memory and I/O organization
Computer Organization : CPU, Memory and I/O organization
 
Basic computer organization and design
Basic computer organization and designBasic computer organization and design
Basic computer organization and design
 
Central processing unit i
Central processing unit iCentral processing unit i
Central processing unit i
 
BASIC COMPUTER ORGANIZATION AND DESIGN
BASIC  COMPUTER  ORGANIZATION  AND  DESIGNBASIC  COMPUTER  ORGANIZATION  AND  DESIGN
BASIC COMPUTER ORGANIZATION AND DESIGN
 
Introduction to Processor Design and ARM Processor
Introduction to Processor Design and ARM ProcessorIntroduction to Processor Design and ARM Processor
Introduction to Processor Design and ARM Processor
 

More from Rai University

Brochure Rai University
Brochure Rai University Brochure Rai University
Brochure Rai University Rai University
 
Bdft ii, tmt, unit-iii, dyeing & types of dyeing,
Bdft ii, tmt, unit-iii,  dyeing & types of dyeing,Bdft ii, tmt, unit-iii,  dyeing & types of dyeing,
Bdft ii, tmt, unit-iii, dyeing & types of dyeing,Rai University
 
Bsc agri 2 pae u-4.4 publicrevenue-presentation-130208082149-phpapp02
Bsc agri  2 pae  u-4.4 publicrevenue-presentation-130208082149-phpapp02Bsc agri  2 pae  u-4.4 publicrevenue-presentation-130208082149-phpapp02
Bsc agri 2 pae u-4.4 publicrevenue-presentation-130208082149-phpapp02Rai University
 
Bsc agri 2 pae u-4.3 public expenditure
Bsc agri  2 pae  u-4.3 public expenditureBsc agri  2 pae  u-4.3 public expenditure
Bsc agri 2 pae u-4.3 public expenditureRai University
 
Bsc agri 2 pae u-4.2 public finance
Bsc agri  2 pae  u-4.2 public financeBsc agri  2 pae  u-4.2 public finance
Bsc agri 2 pae u-4.2 public financeRai University
 
Bsc agri 2 pae u-4.1 introduction
Bsc agri  2 pae  u-4.1 introductionBsc agri  2 pae  u-4.1 introduction
Bsc agri 2 pae u-4.1 introductionRai University
 
Bsc agri 2 pae u-3.3 inflation
Bsc agri  2 pae  u-3.3  inflationBsc agri  2 pae  u-3.3  inflation
Bsc agri 2 pae u-3.3 inflationRai University
 
Bsc agri 2 pae u-3.2 introduction to macro economics
Bsc agri  2 pae  u-3.2 introduction to macro economicsBsc agri  2 pae  u-3.2 introduction to macro economics
Bsc agri 2 pae u-3.2 introduction to macro economicsRai University
 
Bsc agri 2 pae u-3.1 marketstructure
Bsc agri  2 pae  u-3.1 marketstructureBsc agri  2 pae  u-3.1 marketstructure
Bsc agri 2 pae u-3.1 marketstructureRai University
 
Bsc agri 2 pae u-3 perfect-competition
Bsc agri  2 pae  u-3 perfect-competitionBsc agri  2 pae  u-3 perfect-competition
Bsc agri 2 pae u-3 perfect-competitionRai University
 

More from Rai University (20)

Brochure Rai University
Brochure Rai University Brochure Rai University
Brochure Rai University
 
Mm unit 4point2
Mm unit 4point2Mm unit 4point2
Mm unit 4point2
 
Mm unit 4point1
Mm unit 4point1Mm unit 4point1
Mm unit 4point1
 
Mm unit 4point3
Mm unit 4point3Mm unit 4point3
Mm unit 4point3
 
Mm unit 3point2
Mm unit 3point2Mm unit 3point2
Mm unit 3point2
 
Mm unit 3point1
Mm unit 3point1Mm unit 3point1
Mm unit 3point1
 
Mm unit 2point2
Mm unit 2point2Mm unit 2point2
Mm unit 2point2
 
Mm unit 2 point 1
Mm unit 2 point 1Mm unit 2 point 1
Mm unit 2 point 1
 
Mm unit 1point3
Mm unit 1point3Mm unit 1point3
Mm unit 1point3
 
Mm unit 1point2
Mm unit 1point2Mm unit 1point2
Mm unit 1point2
 
Mm unit 1point1
Mm unit 1point1Mm unit 1point1
Mm unit 1point1
 
Bdft ii, tmt, unit-iii, dyeing & types of dyeing,
Bdft ii, tmt, unit-iii,  dyeing & types of dyeing,Bdft ii, tmt, unit-iii,  dyeing & types of dyeing,
Bdft ii, tmt, unit-iii, dyeing & types of dyeing,
 
Bsc agri 2 pae u-4.4 publicrevenue-presentation-130208082149-phpapp02
Bsc agri  2 pae  u-4.4 publicrevenue-presentation-130208082149-phpapp02Bsc agri  2 pae  u-4.4 publicrevenue-presentation-130208082149-phpapp02
Bsc agri 2 pae u-4.4 publicrevenue-presentation-130208082149-phpapp02
 
Bsc agri 2 pae u-4.3 public expenditure
Bsc agri  2 pae  u-4.3 public expenditureBsc agri  2 pae  u-4.3 public expenditure
Bsc agri 2 pae u-4.3 public expenditure
 
Bsc agri 2 pae u-4.2 public finance
Bsc agri  2 pae  u-4.2 public financeBsc agri  2 pae  u-4.2 public finance
Bsc agri 2 pae u-4.2 public finance
 
Bsc agri 2 pae u-4.1 introduction
Bsc agri  2 pae  u-4.1 introductionBsc agri  2 pae  u-4.1 introduction
Bsc agri 2 pae u-4.1 introduction
 
Bsc agri 2 pae u-3.3 inflation
Bsc agri  2 pae  u-3.3  inflationBsc agri  2 pae  u-3.3  inflation
Bsc agri 2 pae u-3.3 inflation
 
Bsc agri 2 pae u-3.2 introduction to macro economics
Bsc agri  2 pae  u-3.2 introduction to macro economicsBsc agri  2 pae  u-3.2 introduction to macro economics
Bsc agri 2 pae u-3.2 introduction to macro economics
 
Bsc agri 2 pae u-3.1 marketstructure
Bsc agri  2 pae  u-3.1 marketstructureBsc agri  2 pae  u-3.1 marketstructure
Bsc agri 2 pae u-3.1 marketstructure
 
Bsc agri 2 pae u-3 perfect-competition
Bsc agri  2 pae  u-3 perfect-competitionBsc agri  2 pae  u-3 perfect-competition
Bsc agri 2 pae u-3 perfect-competition
 

Recently uploaded

The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxShobhayan Kirtania
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 

Recently uploaded (20)

INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 

MCA-I-COA- overview of register transfer, micro operations and basic computer organization and design

  • 1. Overview of Register Transfer, Micro Operations and Basic Computer Organization and Design Course: MCA-I Subject: Computer Organization And Architecture Unit-2 1
  • 2. Program And Instruction • A computer organization involves combining everything we have learned to date into a single integrated unit – What is a computer? • Von Neuman refers to a computer as a “stored program digital computer” – What is a program? • What is an instruction? • How are instructions executed?
  • 3. Computer – High Level View • CPU, Memory and Bus architectures with interface to I/O. Input Output Control Unit (CU) Arithmetic and Logic Unit (ALU) CPU Volatile Memory (RAM) M[0] M[1] M[K] M[L-1] CLK Address Bus Control Bus Data Bus I/O Bus Mano defines Memory as 4096 words. This requires an Address bus of 12 bits to act as selection inputs to address/data multiplexers. The fundamental unit of addressable memory is the word. Each word is 16 bits long. The Data bus carries exactly 1 word of data between Memory and CPU. Input and Output is defined using the ASCII code of length 8 bits.
  • 4. The Mano model of the CPU Registers • CPU registers used in the model (Mano), categorized by length: – PC :: Program counter (address – 12 bits) – AR :: Address register (address – 12 bits) – IR :: Instruction register (data – 16 bits) – DR :: Data register (data – 16 bits) – AC :: Accumulator (data – 16 bits) – INR :: Input buffer register (ASCII data – 8 bits) – OUTR :: Output buffer register (ASCII data – 8 bits) – SCR :: Sequence counter register (4 bits) – E, R :: Single bit flip-flops (flag/utility, interrupt)
  • 5. CPU Register Lengths • The register lengths (number of flip-flops to store bits) are determined by number of memory locations (address space) and the bus width (in bits) that determines the number of bits transferred between Memory and CPU, or between I/O channels and CPU. PC AR DR IR AC INR OUTR SCR 12 bits 16 bits 8 bits 4 bits 1 bit 1 bit E R
  • 6. Stored programs • A stored program is a set of instructions and data expressed in binary language, stored in non-volatile (ie. disk storage) memory • Programs can be executed only from Memory. – Thus, a program must be loaded from disk to RAM in order to execute it. – Loaded programs are called processes. – Individual instructions must be transferred to the CPU where they are executed, using data that must be obtained from either CPU registers or RAM • A process is executed by executing each individual instruction that, collectively, fulfill the intentions of the programmer.
  • 7. Instruction Architecture • The list of all instructions engineered for a computer’s CPU is called the instruction set. • To distinguish each instruction, they are assigned a unique numeric code – Can be done in many ways – Does not need to be ordinal (ie. starting from 0 and running contiguously) – Can be partially ordinal and partially hierarchical • Mano’s approach • Instructions must be capable of referencing Memory and/or CPU addresses in order to cause data to be transferred and operated on.
  • 8. Instruction Architecture • Instructions consist of – Operation code data – Address data – Mode data • Direct addressing – data found at the specified address • Indirect addressing – data found at the address found at the specified address (pointer concept) I OpCode Address 15 14 12 11 0 IR 0 Mode bit 1 The number of memory referenced operands varies from computer to computer. Mano simplifies the instruction architecture to permit zero or one memory address field. In the case of Indirect addressing mode there are two memory accesses, but only one reference.
  • 9. Instruction Hierarchy • It is desirable to engineer the computer to support a reasonable number of independent instructions – Examples: • Add, subtract, transfer, shift, logic, comparison, branch, input, output – 4 bits can be used to support 24 = 16 unique instructions • Leaves 12 bits to represent an address space of 4096 words – However, 16 instructions is not enough for most program needs I OpCode Address 15 14 12 11 0 IR
  • 10. Instruction Hierarchy • It is desirable to engineer the computer to support a reasonable number of independent instructions – Use a hierarchical scheme (1+3 scheme) • OpCode – 3 bits – supports 8 unique codes – 0-6 (instructions) – 7 (toggle) • Mode – 1 bit – supports 2 addressing modes – I = 0 Direct addressing – I = 1 Indirect addressing • Special Case :: OpCode = 7 (toggle) PLUS Mode bit (I) – Use 12 bits of Address field to specify additional instructions I OpCode Address 15 14 12 11 0 IR
  • 11. Instruction Hierarchy • Mano’s instruction set consists of 25 instructions: OpCode (0-6) OpCode (7) Instruction Direct (I=0) Indirect (I=1) Direct (I=0) Indirect (I=1) 4 bit code 0 AND 1 ADD 2 LDA 3 STA 4 BUN 5 BSA 6 ISZ 4 bit code 8 AND 9 ADD A LDA B STA C BUN D BSA E ISZ 16 bit code 7800 CLA 7400 CLE 7200 CMA 7100 CME 7080 CIR 7040 CIL 7020 INC 7010 SPA 7008 SNA 7004 SZA 7002 SZE 16 bit code F800 INP F400 OUT F200 SKI F100 SKO F080 ION F040 IOF 7 6 12
  • 12. Instruction Set Completeness • Selection of instructions should span a variety of applications suitable to support programming – Arithmetic, logical and shift instructions – Instructions for moving data to and from memory and CPU registers – Program control instructions, instructions that check status conditions – Input and Output instructions • An important issue for many applications is the number of programmable (general purpose) registers. • Mano adopts a minimalist approach roviding a single such register, the accumulator AC. • This simple case does allow full illustration of all computational requirements of a more powerful computer with a larger instruction set (but with much added cost to programming). • Among commercial computers one finds both complex (large number) instruction sets (CISC) and reduced (number) instruction sets (RISC).
  • 13. Instruction Processing & Instruction Cycle • Instruction processing cannot occur in a single clock cycle – it is too complicated ! – Must fetch the instruction from memory and load the instruction register, IR. – Must decode the Operation Code to determine whether data must be fetched and whether we fetch data directly, or indirectly – Must fetch required data, if any, from memory into CPU • OR, must store data from CPU into memory • OR, must obtain data from Input • OR, must place data for Output – Must process the data according to instruction logic • Thus, the instruction cycle consists of a controlled sequence of microoperations
  • 14. Timing and Control • In order to control the steps of the instruction cycle, it is necessary to introduce a counter, whose output is used as input to the control logic – We will utilize a Sequence Counter Register (SC, or SCR). This is a register that holds a count value, can be reset to zero and can be incremented (or decremented) by one – Each instruction will require a specified number of time steps to complete a sequence of microoperations. Each step of the sequence is marked by a count value in SC. SC CLR INC ……
  • 15. Timing and Control • The SC outputs a string of bits whose value is in the range from 0 to 2L -1 – Eg. for L=3, from 0 to 7 • We need a way of converting the bit string value to single bit valued outputs labelled T0, T1, T2, T3, and so on, up to Tx (where x = 2L -1) • A decoder serves our purpose, recalling that the output from the DEC is a 1 only on one line (the rest are 0`s) SC CLR INC …… L-to-2L DEC … ….. Tx T2 T1 T0
  • 16. Timing and Control • Step 1: Where do we fetch the next instruction from at T0 (start time)? – The Program Counter register (PC) is assumed to hold the address of the next instruction to be executed. • It is loaded initially during the machine bootstrapping process. – The PC is transferred to the Address Register (AR) which is connected to the Address Bus Multiplexer. • The AR provides the selection input to the address bus multiplexer to enable RAM-CPU data transfers T0 : AR = PC PC AR Load
  • 17. Timing and Control • Step 2: How do we obtain the instruction from memory at T1? – The data stored at the selected address is transferred onto the Data Bus and then to the Data Register (DR) in the CPU. – The instruction data is transferred immediately to the Instruction Register (IR) T1 : DR = M[AR] , IR = DR , PC = PC + 1 IR PC AR Memory Data bus Address bus CPU bus DRM[AR] INC LD LD LD
  • 18. Timing and Control • Step 3: How do we decode the instruction intention (ie. meaning, operational definition) at T2? – The OpCode, Mode and Address field bits all serve as inputs to the Control Logic Gates that select the specific instruction semantics • Direct addressing • Indirect addressing • CPU register addressing • Input • Output T2 : {D0,...,D7} = DEC( IR(12-14) ), AR = IR(0-11), I = IR(15) Note the reference to a DECoder unit to explicitly access the IR bits indicated The AR may be directly connected to the IR address bits indicated
  • 19. Timing and Control • The instruction cycle consists of a controlled sequence of microoperations using control logic gates and a sequence counter. I OpCode Address 15 14 13 12 11 0IR 2 1 0 3x8 DEC 7 6 5 4 3 2 1 0 F E D C B A 9 ... 1 0 4x16 DEC 3 2 1 0 4-bit Sequence Counter (SC) INC CLR Control Logic Gates Control Outputs Clock has not been included! Enable one specific logic circuit Signal the SC to advance (INC) to next timing value, or reset. Connect it all together ! Timing inputs
  • 20. An Architectural Basis for Programming • Programs are written by humans and typically use high-level languages to express logic. – Programmers learn to use languages based on expressiveness and ease of use – Language designers are not limited by imagination in developing new operations and techniques – But, too much complexity presents real difficulties for practical, widespread usage. • Computer Instruction Sets are limited by the complexities of – Working with materials on a micro- and nano-scale of fabrication – Understanding of fundamental physics applied to signaling and electromagnetic properties of matter – Optimal design of complicated circuits with well-posed input/output logics – Power efficiency issues, temperature control – Performance and timing considerations – Many other practical and theoretical objectives
  • 21. An Architectural Basis for Programming • Thus, Instruction Sets are minimal reflections (subduced mappings) of high-level operation and function sets – Limited number of hardware operations • Assignment = Transfer • Integer arithmetic (may include optimized floating point) • Logic, Shift • Non-sequential control (branching for decision and repetition) • Input and Output • Communications • Specialized operations (string, array) • Specialized addressing modes • Enhanced data and register access modes
  • 22. Instruction Categories • Instructions may be placed in several different kinds of categories – Conceptual application, or meaning – Performance based on location of operation • Studies of application programs have found that most programs perform best when optimized for use of the CPU (called CPU intensive jobs) • However, many programs must interact with peripheral devices that operate on relatively slow electromechanical hardware (called I/O intensive jobs) • Typically, programs are hybrids that must access I/O, memory and CPU in various combinations and for different intervals of intensive use of a particular resource. • We adopt a performance based on location categorization of instructions – Register reference – Memory reference – I/O reference – Within each category above we define conceptual subcategories
  • 23. Register Reference Instructions • Referencing CPU registers for data processing is the fastest data access possible – We consider two registers • The Accumulator (AC) – Used for arithmetic, logic and shift – Also used for input and output • The E-bit (E) utility flip-flop – Used in shift operations – May be used in arithmetic operations AC E 0 1 1 1 Operation control bits 15 14 12 11 0 IR
  • 24. Register Reference Instructions • The complete set of all instructions defined by Mano – Mnemonic means a string that suggests the meaning. Hex Mnemonic Binary coding Meaning 7800 CLA 0111100000000000 CLear Accumulator 7400 CLE 0111010000000000 CLear E 7200 CMA 0111001000000000 CoMplement Accumulator 7100 CME 0111000100000000 CoMplement E 7080 CIR 0111000010000000 CIrcular shift Right 7040 CIL 0111000001000000 CIrcular shift Left 7020 INC 0111000000100000 INCrement AC 7010 SPA 0111000000010000 Skip if Positive Accumulator 7008 SNA 0111000000001000 Skip if Negative Accumulator 7004 SZA 0111000000000100 Skip if Zero Accumulator 7002 SZE 0111000000000010 Skip if Zero E 7001 HLT 0111000000000001 HaLT the computer
  • 25. Register Reference Instructions • Within this instruction subset, one may find it convenient to group the instructions by which register is affected Hex Mnemonic 7800 CLA 7200 CMA 7080 CIR 7040 CIL 7020 INC 7010 SPA 7008 SNA 7004 SZA 7400 CLE 7100 CME 7002 SZE 7001 HLT AC affected E affected Control affected
  • 26. Register Reference Instructions • Clear, Complement or Increment : AC register. • Clear, Complement : E register Hex Mnemonic RTL 7800 CLA AC = 0 7200 CMA AC = ~ AC 7020 INC AC = AC + 1 Hex Mnemonic RTL 7400 CLE E = 0 7100 CME E = ~ E AC CLA CMA INC E CLE CME
  • 27. Register Reference Instructions • Shift AC register. – This is a circular shift that is performed using the E register – Control over timing ensures all operations operate in parallel • Eg. Use master-slave flip-flops in registers Hex Mnemonic RTL 7080 CIR AC(0-14) = AC(1-15), AC(15) = E, E = AC(0) 7040 CIL AC(1-15) = AC(0-14), AC(0) = E, E = AC(15) AC E
  • 28. Register Reference Instructions • Skip on <condition> : AC register. – Tests sign/value status of 2’s complement integer in AC – If status matches query, advance PC by one instruction word • Skip on Zero condition : E register – Test status of E bit. If not zero, proceed to the next instruction. – If zero, advance PC by one instruction word (recall that it has already been incremented by one, so this causes skipping the next instruction in contiguous sequence. Hex Mnemonic RTL 7002 SZE ~ E : PC = PC + 1 Hex Mnemonic RTL 7010 SPA ( AC > 0 ) : PC = PC + 1 7008 SNA ( AC < 0 ) : PC = PC + 1 7004 SZA ( AC = 0 ) : PC = PC + 1
  • 29. Register Reference Instructions • Halting the computer – Disable all circuits (over-ride all specific Enable controls with a general Disable). • Bootstrapping the computer – “Turning on” the computer simply refers to supplying electricity to the circuits and to the clock – Since no instruction may be fetched to IR for execution unless a RAM address is specified for the instruction, it is necessary to explicitly load the PC with an initial instruction address. – The textbook does not discuss this matter very much. To state it briefly, a special memory called a ROM (a non-volatile memory device) contains a sequence of instructions that loads an operating system program, from disk into memory, and with the PC set to an initial instruction address. Hex Mnemonic RTL 7001 HLT Disable all circuits
  • 30. Memory Reference Instructions • Once an instruction has been loaded to IR, it may require further access to memory to perform its intended function – Direct Access – access the storage at the specified IR address – Indirect Access – first, transfer to DR the data stored at the specified IR address, then (after transferring DR to AR), access this fetched address to perform the required function. Operation Codes Direct Indirect I=0 I=1 Mnemonic 0 8 AND 1 9 ADD 2 A LDA 3 B STA 4 C BUN 5 D BSA 6 E ISZ I OpCode Memory Address 15 14 12 11 0 IR
  • 31. Memory Reference Instructions • Direct access mode (I=0) operation semantics Operation Codes Direct I=0 Mnemonic RTL 0 AND DR = M[AR] ; AC = AC ^ DR 1 ADD DR = M[AR] ; AC = AC + DR 2 LDA DR = M[AR] ; AC = DR 3 STA DR = AC ; M[AR] = DR 4 BUN AR = IR(0-11) ; PC = AR 5 BSA AR = IR(0-11) ; M[AR] = PC , PC = AR + 1 6 ISZ AR = IR(0-11) ; DR = M[AR] ; AC = DR ; AC = AC + 1 ; DR = AC ; M[AR] = DR , (AC=0) : PC = PC + 1 The actual number of timing steps (Tk) may vary from 1 to 2 (or even 3) steps, depending on how the control timing circuits are designed.
  • 32. Memory Reference Instructions • Indirect access mode (I=1) operation semantics using AND and ADD – First, fetch the pointer (address) data from memory to obtain the indirect reference – Second, fetch the needed data from the just-fetched address Operation Codes Indirect I=1 Mnemonic RTL 8 AND AR = IR(0-11) ; DR = M[AR] AR = DR(0-11) ; DR = M[AR] AC = AC ^ DR 9 ADD AR = IR(0-11) ; DR = M[AR] AR = DR(0-11) ; DR = M[AR] AC = AC + DR The actual number of timing steps (Tk) may vary from 2 to 3 steps, depending on how the control timing circuits are designed.
  • 33. Memory Reference Instructions • Transfer instructions – Copy data to or from memory and CPU • Loading (fetching) refers to memory-to-CPU transfers • Storing refers to CPU-to-memory transfers Operation Codes Direct Indirect I=0 I=1 Mnemonic RTL 2 A LDA DR = M[AR] ; AC = DR 3 B STA DR = AC ; M[AR] = DR M DR AR AC Address MUX Data bus
  • 34. Memory Reference Instructions • ADDition, Logical AND instructions – Logical AND is done on all bits in parallel – Numeric (2’s complement) addition may be done in serial, or in parallel using Look-Ahead circuits Operation Codes Direct Indirect I=0 I=1 Mnemonic RTL 0 8 AND DR = M[AR] ; AC = AC ^ DR 1 9 ADD DR = M[AR] ; AC = AC + DR M DR AR AC Address MUX Data bus ADD/AND Logic
  • 35. Memory Reference Instructions • Branching – Instructions that explicitly modify the PC during execution – This implies that the next instruction to be executed is not located in the next contiguous word of storage. – Used to program IF-THEN-ELSE (Decision control) and WHILE-DO (Repetition control) constructs in high-level languages. PC M Current instr. Next instr. (a) BEFORE COMPLETION OF EXECUTION (after DECoding) PC M Current instr. Next instr. (b) AFTER COMPLETION OF EXECUTION This is called a Branch Point Address
  • 36. Memory Reference Instructions • Timing and control logic must be carefully worked out for all steps in the instruction. – For example, using the AND instruction: – Note how the Direct and Indirect forms of the instruction are differentiated using the I (or I’) bit value for control differentiation. T0: AR = PC, SC = SC + 1 T1: IR = M[AR], PC = PC +1, SC = SC +1 T2: {D0..D7} = DEC(IR(12..14)), AR = IR(0..11), I = IR(15), SC = SC+1 D0.T3: DR = M[AR], SC = SC+1 I’.D0.T4: AC = AC^DR, SC = 0 I.D0.T4: AR = DR(0..11), SC = SC+1 I.D0.T5: DR = M[AR], SC = SC+1 I.D0.T6: AC = AC^DR, SC = 0
  • 37. Memory Reference Instructions • Branch UNconditional instruction – I = 0 :: Replace PC by address in IR(0-11) – I = 1 :: Replace PC by the address found at the address in IR(0-11) • That is :: PC = M[ M[ IR(0-11) ] ] Operation Codes Direct Indirect I=0 I=1 Mnemonic RTL 4 C BUN AR = IR(0-11) PC = AR M DR AR P C Address MUX Data bus IR I=1 I=0
  • 38. Memory Reference Instructions • Branch and SAve instruction – Used for programming subroutine calls Operation Codes Direct Indirect I=0 I=1 Mnemonic RTL 5 D BSA AR = IR(0-11) M[AR] = PC , PC = AR + 1 PC M Subr. call instr. Subr. entry instr. (a) BEFORE SUBROUTINE CALL PC M Return addr. Subr. call instr. Subr. entry instr. (b) AFTER SUBROUTINE CALL
  • 39. Memory Reference Instructions • Increment and Skip if Zero instruction – Used to implement a counter based <do-while> construct I=0 I=1 Mnemonic RTL 6 E ISZ AR = IR(0-11) , DR = M[AR] AC = DR , AC = AC + 1 , DR = AC M[AR] = DR , (AC=0) : PC = PC + 1 PC M Data value Current instr. Branch instr. Continue instr. (a) BEFORE (b) AFTER PC M Data value + 1 Current instr. Branch instr. Continue instr. < 0 = 0 AR AR
  • 40. Input/Output Instructions • Used for communicating data between CPU and I/O peripheral devices • Also, need instructions to support programmed polling. – Polling refers to waiting for a condition to be true before proceeding 16 bit OpCode Mnemonic Meaning F800 INP Input ASCII char F400 OUT Output ASCII char F200 SKI Skip if input flag (FGI=1) F100 SKO Skip if output flag (FGO=1) 1 1 1 1 I/O operation control bits 15 14 12 11 0 IR F 8 4 2 1
  • 41. Input/Output Instructions • Each peripheral device has a communications and control interface that interacts with the computer’s interface logic circuits – Input • Need a data buffer (INPR) and a flag (FGI) indicating buffer empty/full – Output • Need a data buffer (OUTR) and a flag (FGO) indicating buffer empty/full OUTR FGO Data Status Receiver Interface Printer Keyboard Transmitter Interface PERIPHERAL DEVICES CPU INPR AC(H) AC(L) FGI Data Status NOTE: Only the low order part of AC is used.
  • 42. Interrupts • Input and Output interactions with electromechanical peripheral devices require huge processing times compared with CPU processing times – I/O (milliseconds) versus CPU (nano/micro-seconds) • Interrupts permit other CPU instructions to execute while waiting for I/O to complete – Need an additional 1-bit IEN flip-flop to store the interrupt status (0/1) 16 bit OpCode Mnemonic Meaning F080 ION Interrupt Enabled (IEN  1) F040 IOF Interrupt Disabled (IEN  0) 1 1 1 1 I/O operation control bits 15 14 12 11 0 IR IEN
  • 43. Interrupts • In this approach, interrupts are used only with I/O handling – In addition to a flip-flop to store the Interrupt Enable state, one more flip-flop (R) is needed to store the I/O Status (Ready/Not_ready). – In general, interrupts may be used with arbitrary instructions for exception trapping and handling RR  1 =1 =1 IENIEN FGI FG0 FGI FGO Control Bus =1 =0 =0 =0 All of these flipflops are assumed to be reset to 0 when bootstrapping the computer. 1-bit registers We will also require one final register, called TR (for transfer). This can be 16 bits, but must be at least 12 bits.
  • 44. Interrupt Handling Flowchart R IEN FGI FGO Store return address in location 0 M[0]  PC Branch to location 1 PC  1 Reset Interrupt, Ready IEN  0 R  0 =1 Interrupt Cycle R  1 =1 =1 IEN FGI FG0 Control Bus =1 =0 =0 =0 Fetch/Decode Instruction Execute Instruction R =0Instruction Cycle TR
  • 45. Interrupt Handling Flowchart Store return address in location 0 M[0]  PC Branch to location 1 PC  1 Reset Interrupt, Ready IEN  0 R  0 =1 Interrupt Cycle R Main Prog. Curr Instr. Next Instr. 0 BUN 1120 I/O Program 1 BUN 0 255 PC=256 0 1 1120 Memory (a) BEFORE Main Prog. Curr Instr. Next Instr. 256 0 BUN 1120 I/O Program 1 BUN 0 255 256 0 PC=1 1120 Memory (b) AFTER Interrupt R T0 : AR  0 , TR  PC NOTE TRANSFER REG. R T1 : M[AR]  TR , PC  0 R T2 : PC  PC + 1 , IEN  0 , R  0 , SC  0
  • 46. Control Logic • Timing of microoperations requires explicit enabling of logic circuits through the Control Unit logic gates
  • 47. Timing and Control - Revisited • The instruction cycle consists of a controlled sequence of microoperations using control logic gates and a sequence counter. I OpCode Address 15 14 13 12 11 0IR 2 1 0 3x8 DEC 7 6 5 4 3 2 1 0 F E D C B A 9 ... 1 0 4x16 DEC 3 2 1 0 4-bit Sequence Counter (SC) INC CLR Control Logic Gates Control Outputs
  • 48. Control Logic • Timing of microoperations requires explicit enabling of logic circuits through the Control Unit logic gates • Need signals … – to control the inputs of the 9 registers – to control the read and write inputs of memory – to set, clear or complement the flip-flops – for Selector inputs to select a register for the bus – to control the AC adder, logic and shift circuit
  • 49. Control Logic – Example: AR • Consider all instructions that modify the AR register • Construct an AR control circuit Condition Microoperation R’ T0 : AR  PC R’ T2 : AR  IR(0-11) D7’ I T3 : AR  M[AR] R T0 : AR  0 D5 T4 : AR  AR + 1 AR To From Bus Bus Clk D7’ I T3 T2 R T0 D5 T4 LD IN C CL R
  • 50. Control Logic • In previous lectures we discussed complex register circuits – Control was exerted through enabling inputs • The textbook provides additional examples of controlling logic circuits – Control of single flip-flops – Control of common bus • All registers can be adapted to controls • Indeed, all computer circuits can be adapted to controls – Using enable inputs – Using control circuits – Using counters, and so on.
  • 51. Representing a Complete Architecture • Small Scale Integration – Logic Gates – Simple Circuits – Combinational & Sequential • Medium Scale Integration – Functional Circuits and Control Logic – Arithmetic, Logic, Shift, Comparison – Decoders – Multiplexers • Large Scale Integration – CPU • Instruction set – Arithmetic & Logic Unit Subsystem • Control logic – Control Unit Subsystem • Registers – Memory • Memory storage cells • Address, Data and Control Bus structure – Input-Output • Buffer registers, Control
  • 52. Representing a Complete Architecture • Hardware – CPU • Instruction set – Arithmetic & Logic Unit Subsystem • Control logic – Control Unit Subsystem • Registers – Memory • Memory storage cells • Address, Data and Control Bus structure – Input-Output, Bus Network • Buses, Buffer registers, Control Memory 4096 words 16 bits/word CPU 9 Registers - AR, PC, DR, AC, IR, TR, OUTR, INPR, SC 7 Flip-flops - I, S, E, R, IEN, FGI, FGO 2 Decoders - 3x8 Operation DEC, 4x16 Timing DEC Control logic, ALU circuits Buses Address Data Control Buffer connections
  • 53. Hardware Components of BC A memory unit: 4096 x 16. Registers: AR, PC, DR, AC, IR, TR, OUTR, INPR, and SC Flip-Flops(Status): I, S, E, R, IEN, FGI, and FGO Decoders: a 3x8 Opcode decoder a 4x16 timing decoder Common bus: 16 bits Control logic gates: Adder and Logic circuit: Connected to ACControl Logic Gates - Input Controls of the nine registers - Read and Write Controls of memory - Set, Clear, or Complement Controls of the flip-flops - S2, S1, S0 Controls to select a register for the bus - AC, and Adder and Logic circuit
  • 54. CONTROL OF REGISTERS AND MEMORY Scan all of the register transfer statements that change the content of AR: LD(AR) = R'T0 + R'T2 + D'7IT3 CLR(AR) = RT0 INR(AR) = D5T4 Address Register; AR R’T0: AR ← PC LD(AR) R’T2: AR ← IR(0-11) LD(AR) D’7IT3: AR ← M[AR] LD(AR) RT0: AR ← 0 CLR(AR) D5T4: AR ← AR + 1 INR(AR) AR LD INR CLR Clock To bus 12 From bus 12 D' I T T R T D T 7 3 2 0 4
  • 55. CONTROL OF FLAGS pB7: IEN  1 (I/O Instruction) pB6: IEN  0 (I/O Instruction) RT2: IEN  0 (Interrupt) p = D7IT3 (Input/Output Instruction) IEN: Interrupt Enable Flag D I T3 7 J K Q IEN p B7 B6 T2 R
  • 56. CONTROL OF COMMON BUS For AR D4T4: PC  AR D5T5: PC  AR x1 = D4T4 + D5T5 x1 x2 x3 x4 x5 x6 x7 Encoder S 2 S 1 S 0 Multiplexer bus select inputs x1 x2 x3 x4 x5 x6 x7 S2 S1 S0 selected register 0 0 0 0 0 0 0 0 0 0 none 1 0 0 0 0 0 0 0 0 1 AR 0 1 0 0 0 0 0 0 1 0 PC 0 0 1 0 0 0 0 0 1 1 DR 0 0 0 1 0 0 0 1 0 0 AC 0 0 0 0 1 0 0 1 0 1 IR 0 0 0 0 0 1 0 1 1 0 TR 0 0 0 0 0 0 1 1 1 1 Memory
  • 57. DESIGN OF ACCUMULATOR LOGICCircuits associated with AC All the statements that change the content of AC 16 16 8 Adder and logic circuit 16 ACFrom DR From INPR Control gates LD INR CLR 16 To bus Clock D0T5: AC  AC ∧ DR AND with DR D1T5: AC  AC + DR Add with DR D2T5: AC  DR Transfer from DR pB11: AC(0-7)  INPR Transfer from INPR rB9: AC  AC′ Complement rB7 : AC  shr AC, AC(15)  E Shift right rB6 : AC  shl AC, AC(0)  E Shift left rB11 : AC  0 Clear rB5 : AC  AC + 1 Increment
  • 58. CONTROL OF AC REGISTER Gate structures for controlling the LD, INR, and CLR of AC AC LD INR CLR Clock To bus16From Adder and Logic 16 AND ADD DR INPR COM SHR SHL INC CLR D0 D1 D2 B11 B9 B7 B6 B5 B11 r p T5 T5
  • 59. ALU (ADDER AND LOGIC CIRCUIT) One stage of Adder and Logic circuit AND ADD DR INPR COM SHR SHL J K Q AC(i) LD FA C C From INPR bit(i) DR(i) AC(i) AC(i+1) AC(i-1) i i i+1 I
  • 60. Reference Reference Book • Computer Organization & Architecture 7e By Stallings • Computer System Architecture By Mano