Unit 111 COAaa
Unit 111 COAaa
to
Computer Architecture
Prepared by:
Ruby Dahiya,PhD
Faculty (IITM)
What is Computer Organization and
Computer Architecture?
• Computer Organization is concerned with the
way hardware components operate and the
way they are connected together to form the
computer system.
• Computer Architecture is concerned with the
structure and behavior of the computer seen
by the user.
It includes the information, formats, the
instruction set and techniques for addressing
memory. Computer Architecture BCA-203 2
What is Computer Design?
• Computer design is concerned with
the hardware design of the
computer.
• With the formulated computer
specifications, a designer has to
develop hardware for the system.
Register Transfer
Microoperations
• The operations on the data in registers are called
micro operations.
• The functions built into registers are examples of
micro operations
– Shift
– Load
– Clear
– Increment
–…
- Micro-operations set
15 0 15 8 7 0
R2 PC(H) PC(L)
Numbering of bits Subfields
t t+1
Timing diagram
Clock
Load
Transfer occurs here
• The same clock controls the circuits that generate the control function
and the destination register
• Registers are assumed to use positive-edge-triggered flip-flops
Computer Architecture BCA- 203 19
Simultaneous Operations
• If two or more operations are to occur
simultaneously, they are separated with
commas
P: R3 R5, MAR IR
Bus lines
Computer Organization
MCA 107 25
Register A Register B Register C Register D
1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4
B1 C 1 D1 B2 C2 D2 B3 C 3 D 3 B4 C 4 D 4
0 0 0 0
4 x1 4 x1 4 x1 4 x1
MUX MUX MUX MUX
x
select
y
4-line bus
Computer Organization MCA 107 26
Transfer From Bus To A Destination Register
Bus lines
Load
Reg. R0 Reg. R1 Reg. R2 Reg. R3
D0 D1 D2 D3
z E (enable)
Select 2x4
w
Decoder
S0 0
Select S1
1
2
Enable 3
Computer Organization MCA 107 27
Bus Transfer In RTL
• Depending on whether the bus is to be mentioned
explicitly or not, register transfer can be indicated as
either
R2 R1
Memory Read
AR
unit Write
Arithmetic Micro-operations
Read: DR ← M[AR]
Write: M[AR] ← R1
B3 A3 B2 A2 B1 A1 B0 A0
FA C3 FA C2 FA C1 FA C0
C4 S3 S2 S1 S0
B3 A3 B2 A2 B1 A1 B0 A0
C3 C2 C1 C0
FA FA FA FA
C4 S3 S2 S1 S0
Computer Architecture BCA 203 41
Binary Incrementer
A3 A2 A1 A0 1
x y x y x y x y
HA HA HA HA
C S C S C S C S
C4 S3 S2 S1 S0
1 0 1 0 D=A+1 Increment A
1 1 0 1 D=A-1 Decrement A
1 1 1 1 D=A Transfer A
Boolean Micro-
Name
Function Operations
0000 F0 = 0 F0 Clear
0001 F1 = xy FAB AND
0010 F2 = xy' F A B’
0011 F3 = x FA Transfer A
0100 F4 = x'y F A’ B
0101 F5 = y FB Transfer B
0110 F6 = x y FAB Exclusive-OR
0111 F7 = x + y FAB OR
1000 F8 = (x + y)' F A B)’ NOR
1001 F9 = (x y)' F (A B)’ Exclusive-NOR
1010 F10 = y' F B’ Complement B
1011 F11 = x + y' FAB
1100 F12 = x' F A’ Complement A
1101 F13 = x' + y F A’ B
1110 F14 = (xy)' F (A B)’ NAND
1111 F15 = 1 F all 1's Set to all 1's
Computer Architecture BCA 203 47
Hardware Implementation Of Logic Micro
operations
Ai
0
Bi
1
4X1 Fi
MUX
2
3 Select
S1
S0
Function table
S1 S0 Output -operation
0 0 F=AB AND
0 1 F = AB OR
1 0 F=AB XOR
1 1 F = A’ Complement
1 1 0 0 At
1010B
1 1 1 0 At+1 (A A + B)
1 1 0 0 At
1010B
0 1 1 0 At+1 (A A B)
1 1 0 0 At
1010B
0 1 0 0 At+1 (A A B’)
1 1 0 0 At
1010B
1 0 0 0 At+1 (A A B)
1 1 0 0 At
1010B
0 1 1 0 At+1 (A A B)
Boolean Micro-
Name
Function Operations
0000 F0 = 0 F0 Clear
0001 F1 = xy FAB AND
0010 F2 = xy' F A B’
0011 F3 = x FA Transfer A
0100 F4 = x'y F A’ B
0101 F5 = y FB Transfer B
0110 F6 = x y FAB Exclusive-OR
0111 F7 = x + y FAB OR
1000 F8 = (x + y)' F A B)’ NOR
1001 F9 = (x y)' F (A B)’ Exclusive-NOR
1010 F10 = y' F B’ Complement B
1011 F11 = x + y' FAB
1100 F12 = x' F A’ Complement A
1101 F13 = x' + y F A’ B
1110 F14 = (xy)' F (A B)’ NAND
1111 F15 = 1 F all 1's Set to all 1's
Computer Architecture BCA 203 58
Hardware Implementation Of Logic Micro
operations
Ai
0
Bi
1
4X1 Fi
MUX
2
3 Select
S1
S0
Function table
S1 S0 Output -operation
0 0 F=AB AND
0 1 F = AB OR
1 0 F=AB XOR
1 1 F = A’ Complement
1 1 0 0 At
1010B
1 1 1 0 At+1 (A A + B)
1 1 0 0 At
1010B
0 1 1 0 At+1 (A A B)
1 1 0 0 At
1010B
0 1 0 0 At+1 (A A B’)
1 1 0 0 At
1010B
1 0 0 0 At+1 (A A B)
1 1 0 0 At
1010B
0 1 1 0 At+1 (A A B)
15 0
4095
300 1350
457 Operand
1350 Operand
+ +
AC AC
15 0
IR CPU
15 0 15 0
TR DR
7 0 7 0 15 0
OUTR INPR AC
LD INR CLR
PC 2
LD INR CLR
DR 3
LD INR CLR
E
ALU AC 4
LD INR CLR
INPR
IR 5
LD
TR 6
LD INR CLR
OUTR
Clock
LD
16-bit common bus
Computer Architecture BCA 203 80
Common Bus System
Read
INPR
Memory Write
4096 x 16
Address E ALU
AC
L I C
L I C L
L I C DR IR L I C
PC TR
AR OUTR LD
L I C
7 1 2 3 4 5 6
3x8
decoder
7 6543 210
D0
I Combinational
D7 Control Control
logic signals
T15
T0
15 14 . . . . 2 1 0
4 x 16
decoder
T0
T1
T2
T3
T4
D3
CLR
SC
T1
S2
T0 S1 Bus
S0
Memory
7
unit
Address
Read
AR 1
LD
PC 2
INR
IR 5
LD Clock
Common bus
T0
AR PC
T1
IR M[AR], PC PC + 1
T2
Decode Opcode in IR(12-14),
AR IR(0-11), I IR(15)
T3 T3 T3 T3
Execute Execute AR M[AR] Nothing
input-output register-reference
instruction instruction
SC 0 SC 0 Execute T4
memory-reference
instruction
SC 0
D'7IT3: AR M[AR]
D'7I'T3:Nothing
D7I‘ T3: Execute a register-reference instr.
D 7I T 3 : Execute an input-output instr.
Computer Architecture BCA 203 94
Register Reference Instructions
Register Reference Instructions are identified when
- D7 = 1, I = 0
- Register Ref. Instr. is specified in b0 ~ b11 of IR
- Execution starts with timing signal T3
r = D7 IT3 => Register Reference Instruction
Bi = IR(i) , i=0,1,2,...,11
r: SC 0
CLA rB11: AC 0
CLE rB10: E0
CMA rB9: AC AC’
CME rB8: E E’
CIR rB7: AC shr AC, AC(15) E, E AC(0)
CIL rB6: AC shl AC, AC(0) E, E AC(15)
INC rB5: AC AC + 1
SPA rB4: if (AC(15) = 0) then (PC PC+1)
SNA rB3: if (AC(15) = 1) then (PC PC+1)
SZA rB2: if (AC = 0) then (PC PC+1)
SZE rB1: if (E = 0) then (PC PC+1)
HLT rB0: S Architecture
Computer 0 (S isBCAa start-stop
203 flip-flop) 95
Lecture - 12
• ADD to AC
D1T4: DR M[AR] Read
operand
D1T5: AC AC + DR, E Cout, SC 0
Add to AC and store carry in E
• STA: Store AC
D3T4: M[AR] AC, SC 0
AR = 135 135 21
136 Subroutine PC = 136 Subroutine
D6T4: DR M[AR]
D6T5: DR DR + 1
D6T4: M[AR] DR,
if (DR = 0) then (PC PC + 1), SC 0
D0 T 4 D1 T 4 D2 T 4 D3T 4
DR M[AR] DR M[AR] DR M[AR] M[AR] AC
SC 0
D5T 5 D6T 5
PC AR DR DR + 1
SC 0
D6T 6
M[AR] DR
If (DR = 0)
then (PC PC + 1)
SC 0
Computer Architecture BCA 203 103
Lecture - 13
AC
Transmitter
Keyboard interface INPR FGI
D7IT3 = p
IR(i) = Bi, i = 6, …, 11
p: SC 0 Clear SC
INP pB11: AC(0-7) INPR, FGI 0 Input char. to AC
OUT pB10: OUTR AC(0-7), FGO 0 Output char. from AC
SKI pB9: if(FGI = 1) then (PC PC + 1) Skip on input flag
SKO pB8: if(FGO = 1) then (PC PC + 1) Skip on output flag
ION pB7: IEN 1 Interrupt enable on
IOF pB6: IEN 0 Interrupt enable off
Program-controlled Input/Output
• Program-controlled I/O
- Continuous CPU involvement
I/O takes valuable CPU time
- CPU slowed down to I/O speed
- Simple
- Least hardware
Input
Output
LOOP, LDA DATA
LOP, SKO DEV
BUN LOP
OUT DEV
B6
K
R
T2
Computer Architecture BCA 203 117
Zero Address Instructions
• Expression: X = (A+B)*(C+D)
Postfixed : X = AB+CD+*
TOP means top of stack
M[X] is any memory location
PUSH A TOP = A
PUSH B TOP = B
PUSH C TOP = C
PUSH D TOP = D
ADD B AC = AC + M[B]
STORE T M[T] = AC
LOAD C AC = M[C]
ADD D AC = AC + M[D]
MUL T AC = AC * M[T]
STORE X M[X] = AC
Two Address Instructions
• Expression: X = (A+B)*(C+D)
R1, R2 are registers MOV R1, A R1 = M[A]
MUL R1, R2 R1 = R1 * R2
MOV X, R1 M[X] = R1
Three Address Instructions
• Expression: X = (A+B)*(C+D)
R1, R2 are registers
M[] is any memory location
ADD R1, A, B R1 = M[A] + M[B]
• Zero-address instructions
• They are simple and can be executed quickly since they do not require any
operand fetching or addressing. They also take up less memory space.
• One-address instructions
• They allow for a wide range of addressing modes, making them more flexible
than zero-address instructions. They also require less memory space than two or
three-address instructions.
• Two-address instructions
• They allow for more complex operations and can be more efficient than one-
address instructions since they allow for two operands to be processed in a
single instruction. They also allow for a wide range of addressing modes.
• Three-address instructions
• They allow for even more complex operations and can be more efficient than
two-address instructions since they allow for three operands to be processed in
Disadvantages of Zero-Address, One-Address, Two-Address and
Three-Address Instructions
• Zero-address instructions
• They can be limited in their functionality and do not allow for much flexibility
in terms of addressing modes or operand types.
• One-address instructions
• They can be slower to execute since they require operand fetching and
addressing.
• Two-address instructions
• They require more memory space than one-address instructions and can be
slower to execute since they require operand fetching and addressing.
• Three-address instructions
• They require even more memory space than two-address instructions and can
be slower to execute since they require operand fetching and addressing.