Build A Simple Computer: Lecturer: Pazir Ahmad
Build A Simple Computer: Lecturer: Pazir Ahmad
“Sajjan G. Shiva – Computer Design and Architecture” (p. 262 4th edition.)
It is a 16-bit machine
ASC COMPONENTS
THE ASC ALU
Processes 16-bit numbers in Two’s complement
Supports addition (ADD), complementing (COMP)
, shifting (SHR,SHL)
Can also transfer one of the two input buses
The control unit must guarantee that two components don’t write to a bus at the
same time
CONNECTING
ASC-COMPONENTS
CONNECTING ASC-COMPONENTS 2
CONTROLLING THE DATA FLOW
The control unit sends signals to the different parts of this architecture
These control signals are indicated by red arrows in the diagram on the last slide
They go to:
R1 R2
The statement:
P:R2 R1
• P is control function.
• The other is
datapath(ALU) part
RTL EXAMPLES
R1
clk ld
R2
ld
Memory
MAR
Cin
A
R1
X
B ALU R3
R2
S1S2
0 0 X=A
S1 S2 0 1 X=B
1 0 X=A+B
1 1 X=A+B+Cin
Write all µop of the following circuit.
Does the statement is valid in this circuit : TR PC+1
Write the RTL statements to load 1 into TR.
TR 1
LD
S1 S0 PC 2
0 1 TR into Bus LD INC CLR
1 0 PC into Bus
CLK
If we have several RTL statements , they execute in parallel.
How to make them sequential?
PC 0
PC PC+1
What would be the value of PC ?
T0:PC 0
T0 T1:PC PC+1
.
Seq 3×8 .
counter Decoder .
.
.
T7
CLK
How does ASC work?
INSTRUCTION CYCLE
To execute a program the Control Unit has to:
1. Fetch: Load the current instruction specified by the PC from memory to the IR
2. Decode: Interpret the contents in the Instruction Register (IR)
3. Execute: Execute the specified Instruction
4. go back to 1
To start this cycle the PC has to be loaded with a special address when the computer is
switched on
FETCH IN RTL
We can describe how to fetch the instruction in RTL:
Sometimes the symbolic address (given in the instruction) is not equal to the
effective address
we explain this by looking at an example instruction:
An example of one-address-instruction
LDA WITH DIRECT ADDRESSING
One subcycle has the duration of the longest register transfer time
THE FETCH PHASE
Fetching the instruction (3 subcycles):
Remarks
Note that we have to be able to put the address part of IR on Bus1
Remarks
We have to wait one subcycle for the memory to be read
Example: LDA
INSTRUCTION TYPES IN A SIMPLE COMPUTER(ASC)
1. Arithmetic Instructions(ADD, TCA)
2. Shift/Rotate Instructions (SHR and SHL)
3. Data Movement Instructions.(LDX,STX,LDA,STA)
4. Input/output Instructions(RWD,WWD)
5. Control Instructions(BRU,BIN,BIP, HLT, TDX , and TIX .)
Three instructions need only one register transfer: HLT, SHL, SHR