Professional Documents
Culture Documents
Chapter 5
Chapter 5
1
5-1 INSTRUCTION CODES
Operands
(data)
15 0
Processor register
(Accumulator AC)
300 1350
457 Operand
1350 Operand
+ +
AC AC
11
15 0 4096 x 16
IR
15 0 15 0
TR DR
7 0 7 0 15 0
OUTR INPR AC
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
14
LD INR CLR
PC 2
LD INR CLR
DR 3
LD INR CLR
E
Adder
and
logic
AC 4 Computer Registers
LD INR CLR Common Bus System
INPR
IR 5
LD
TR 6
LD INR CLR
OUTR
Clock
LD
16-bit common bus
15
The input data and output data of the memory are connected to the
common bus
But the memory address is connected to AR
Therefore, AR must always be used to specify a memory address
By using a single register for the address, we eliminate the need for
an address bus that would have been needed otherwise
19
20
21
23
3x8
decoder
7 6543 210
D0
I
D7 Control Control
logic outputs
gates
T15
T0
15 14 . . . . 2 1 0
4 x 16
Sequence decoder
29
Hardwired Control Organization
Computer Organization and Architecture
- Generated by 4-bit sequence counter and 4x16 decoder
- The SC can be incremented or cleared.
T0
T1
T2
T3
T4
D3
CLR
SC
30
A memory read or write cycle will be initiated with the rising edge of a
timing signal
Assume: memory cycle time < clock cycle time!
So, a memory read or write cycle initiated by a timing signal will be
completed by the time the next clock goes through its positive edge
The clock transition will then be used to load the memory word into a
register
The memory cycle time is usually longer than the processor clock cycle
wait cycles
31
T0: AR←PC
Transfers the content of PC into AR if timing signal T0 is active
T0 is active during an entire clock cycle interval
During this time, the content of PC is placed onto the bus (with
S2S1S0=010) and the LD (load) input of AR is enabled
The actual transfer does not occur until the end of the clock cycle when
the clock goes through a positive transition
This same positive clock transition increments the sequence counter SC
from 0000 to 0001
The next clock cycle has T1 active and T0 inactive 32
33
Initially, the Program Counter (PC) is loaded with the address of the first
instruction in the program
The sequence counter SC is cleared to 0, providing a decoded timing
signal T0
After each clock pulse, SC is incremented by one, so that the timing
signals go through a sequence T0, T1, T2, and so on
35
Operation
Symbol Symbolic Description
Decoder
AND D0 AC AC M[AR]
ADD D1 AC AC + M[AR], E Cout
LDA D2 AC M[AR]
STA D3 M[AR] AC
BUN D4 PC AR
BSA D5 M[AR] PC, PC AR + 1
ISZ D6 M[AR] M[AR] + 1, if M[AR] + 1 = 0 then PC PC+1
36
- The effective address of the instruction is in AR and was placed there during
timing signal T2 when I = 0, or during timing signal T3 when I = 1
- Memory cycle is assumed to be short enough to be completed in a CPU cycle
- The execution of MR Instruction starts with T4
AND to AC
D0T4: DR M[AR] Read operand
D0T5: AC AC DR, SC 0 AND with AC
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
37
MEMORY REFERENCE INSTRUCTIONS.
LDA: Load to AC
D2T4: DR M[AR]
D2T5: AC DR, SC 0
STA: Store AC
D4T4: PC AR, SC 0
M[AR] PC, PC AR + 1
D5T5: PC AR, SC 0
D6T4: DR M[AR]
D6T5: DR DR + 1
D0 T 4 D1 T 4 D2 T 4 D 3T 4
DR M[AR] DR M[AR] DR M[AR] M[AR] AC
SC 0
D0 T 5 D1 T 5 D2 T 5
AC AC DR AC AC + DR AC DR
SC <- 0 E Cout SC 0
SC 0
D4 T 4 D5 T 4 D6 T 4
PC AR M[AR] PC DR M[AR]
SC 0 AR AR + 1
D5 T 5 D6 T 5
PC AR DR DR + 1
SC 0
D6 T 6
M[AR] DR
If (DR = 0)
then (PC PC + 1)
SC 0
40
44
To control the Read input of the memory we scan the table again to get these:
D0T4: DR M[AR]
D1T4: DR M[AR]
D2T4: DR M[AR]
D6T4: DR M[AR]
D7′IT3: AR M[AR]
R′T1: IR M[AR]
Read = R′T1 + D7′IT3 + (D0 + D1 + D2 + D6 )T4
45
D
7
p
I J IEN
Q
B7
T3
B6
K
R
T2
J K Q(t+1)
0 0 Q(t)
0 1 0
1 0 1
1 1 Q’(t)
JK FF Characteristic Table
47
8 circuit To bus
From INPR
Control
gates
All the statements that change the content of AC
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 48
rB11 : AC 0 Clear
rB5 : AC AC + 1 Increment
5-10 DESIGN OF ACCUMULATOR LOGIC
Gate structures for controlling
the LD, INR, and CLR of AC
From Adder 16 16 To bus
and Logic AC
D0 AND LD Clock
T5 INR
D1 ADD CLR
D2 LDA
T5
p INPR
B11
r COM
B9
SHR
B7
SHL
B6
INC
B5
CLR
49
B11
Computer Organization and Architecture
ADDER AND LOGIC CIRCUIT
DR(i)
AC(i)
AND
Ci ADD LD
FA Ii J Q
LDA AC(i)
C i+1
INPR K
From
INPR
bit(i)
COM
SHR
AC(i+1)
SHL
AC(i-1)
50