Professional Documents
Culture Documents
SYSTEM
Bus Architecture
S2 Access
Memory unit 111 S1
4096x16 address S0 Select
001
AR
010
PC
011
DR
E
ALU AC 100
INPR
101
IR
110
TR
OUTR
clock
16-bit Bus
Bus Architecture
• The three access select lines determine which register is
allowed to write to the bus at a given time (recall that
only one write at a time is allowed)
• Registers have load input signals (LD) that tell them to
read from the bus
• If registers are smaller than the bus (less bits) than
unused bits are set to 0
• Some registers have additional input signals
– Increment (INR) and Clear (CLR)
– See figure 5-4, page 130 of the textbook
Bus Architecture
• Memory has read/write input signals that tell it
when to take data from the bus and send data to
the bus
• Memory addresses (for both read and write
operations) are always specified via the Address
Register (AR)
– An alternative (used in many architectures) is a two
bus system
• One address bus
• One data bus
Bus Architecture
• Results of all ALU (arithmetic, logic, and shift
operations) are always sent to the Accumulator (AC)
register
– The ALU is the only way to set values into the accumulator
except for the clear (CLR) and increment (INR) control lines
• Inputs to the ALU come from
– The Accumulator (AC)
– The Data Register (DR)
– The Input Register (INPR)
• The E output from the ALU is the carry-out (Extended
AC) bit
– Many architectures pack this into a register with other status
bits such as overflow
Bus Architecture
15 14 12 11 0
I opcode address
Hex Code
Symbol I=0 I=1 Description
AND 0xxx 8xxx Mem AND AC
ADD 1xxx 9xxx Mem + AC
LDA 2xxx Axxx Load AC from Mem
STA 3xxx Bxxx Store AC to Mem
BUN 4xxx Cxxx Unconditional Branch
BSA 5xxx Dxxx Branch to Subroutine
ISZ 6xxx Exxx Increment and Skip if Zero
Register Instructions
• There are 12 instructions in this class
– They can use the “operand field” to specify
the register and type of operation since no
memory address is required
15 14 12 11 0
0 1 1 1 Register operation
Register Instructions
Symbol Hex Code Description
CLA 7800 Clear AC
CLE 7400 Clear E bit
CMA 7200 Complement AC
CME 7100 Complement E bit
CIR 7080 Circulate right AC and E
CIL 7040 Circulate left AC and E
INC 7020 Increment AC
Register Instructions (cont.)
Symbol Hex Code Description
15 14 12 11 0
1 1 1 1 I/O operation
I/O Instructions
Symbol Hex Code Description
3x8 12
Decoder
D7 – D0
n
I Control
T15 – T0 Unit
4x16
Decoder
Increment Lots of combination logic
Sequence
Clear goes in here
Counter Master Clock CSC321
Control Timing/Sequence Counter
• Due to the nature of the Fetch-Execute instruction cycle,
instructions require more than one clock pulse to
complete
• But, not all instructions require the same number of clock
pulses
• Thus, we divide the master clock into unique time steps
– Each time step will provide conditional input to the logic within
the control unit (recall the RTL notation for conditional operation)
• Clock division is performed by the sequence counter
– Recall that you designed one of these on the exam
CSC321
Sequence Counter Timing
Master Clock
T0
T1
T2
T3
• Note that only one timing signal is a logic 1 at any given time
• The counter is modulo 16, T15 returns to T0
• The Master Clock always increments the counter from Tn to Tn+1
• A clear input resets the counter circuit back to T0
• An increment moves the counter from Tn+1 to Tn+2
CSC321
Sequence Counter Timing
• With the set of timing signals we can now
implement RTL statements such as
T0: AR ← PC
CSC321
Instruction Cycle Revisited
• Fetch an instruction from memory
• Decode the instruction
• Read the operands from memory/registers
• Execute the instruction
– The actual implementation of each phase is
dependent on the instruction, although the
fetch and decode phases are common to all
CSC321
Fetch and Decode
• Initially…
– Something (the operating system in the case
of computers that have them, hardware in the
case of computers that don’t have an OS)
places the address of the first program
statement into the Program Counter (PC)
– The Sequence Counter (SC) is cleared to 0
– Program execution begins
CSC321
Instruction Fetch
• Starting at time T0, fetch an instruction
from memory
– What are the RTL statements to perform this
step?
– Hint: the key words are “instruction” and “from
memory”
– Refer to the bus architecture: pg 130 of the
textbook
CSC321
Instruction Fetch
• RTL
T0: AR ← PC
T1: IR ← M[AR], PC ← PC + 1
CSC321
Instruction Decode
• Instruction fetch took two cycles (T0 and
T1) so instruction decode starts at T2
– What are the RTL statements to perform this
step?
– Hint: the key words are “instruction” and
“decode”
– Refer to the bus architecture and the control
unit: pgs 130 and 137 of the textbook
CSC321
The Control Unit
Instruction Register (IR)
15 14 - 12 11 - 0
Other Inputs
3x8 12
Decoder
D7 – D0
n
I Control
T15 – T0 Unit
4x16
Decoder
Increment
Sequence
Clear
Counter Master Clock CSC321
Instruction Decode
• RTL
CSC321
Fetch and Decode
T0: AR ← PC
T1: IR ← M[AR], PC ← PC + 1
T2: D0, … D7 ← Decode IR(12-14), AR ← IR(0-11), I ← IR(15)
CSC321
Fetch and Decode
T1
T0
Bus
IR 101
LD Clock
CSC321
Decoding the Instruction
• Once the instruction is fetched from memory (T0,
T1) and the opcode is passed to the decoder (T2)
the control unit must figure out what to do next
(T3)
– Based on the opcode and the I bit (b15) it must make
decisions regarding operation type (memory, register,
I/O) and operand address mode (direct, indirect)
– Figure 5-9, pg 142 shows the RTL in flow chart form
CSC321
Decoding the Instruction
CSC321
T H A N K
Y O U