8 Bit CPU Design Document
8 Bit CPU Design Document
Design
Document
By Hijab Ejaz
29247
Registers
This counter has the option for a limit. This will be used
In our step counter. The limit is incremented since the
Counter needs to reach that limit and then go to zero.
ALU
The answer to each operation is fed into a multiplexer that choose the desired answ
With the help of 4 control lines
ALU – 8-Bit Addition 4-Bit Adder
Addition is built up by the following
1-Bit Adder
2s compliment
8-Bit Adder
ALU-Subtraction
I had to make a separate subtraction circuit since the 2s compliment had a
Carry out that I was not able to correctly transfer to the second 4-bit subcircuit
2s compliment
Increment is just 8 1-bit adders cascading. Decrement is also the same but now we are adding
8-bit number is added with 00000001 -1. 2s compliment of 00000001 -> 11111110 -> 1111111
Left-Shift and Right-Shift
First 2 bits go into 0 and 1. This shifts them
to left. The next two bits will become the
2nd and 3rd bit.
Left-Shift
Right-Shift
Right-Shift can be one in the same way, j=only difference being that we are
2-bit Left Shift starting from the 2 MSB and hence the last 2 will go into 0 and 1 and then
the second last will be propagated to the third last.
I had originally planned for 16 operations in the ALU but then when I starting
ALU-MUX working on the opcodes I realized that would need a higher level of complexit
Hence some inputs in the MUX are empty.
This is where the limited program counter comes in. It will be limited
to 7 or 111. From 000-100 the instruction will be fetched from the ram
and from 101-111 the instruction will be executed.
I have arranged the data in the RAM by using even and odd addresses.
Fetch Unit At the even address, the opcode is stored and at the next odd address
the data to be operated on is stored.
What gates the fetch unit will open in what clock cycle
The opcode reaches the instruction register which is feeding into the
execute unit.