$\require{cancel}$
Building the ALU for the 8 bit computer.
- We need to figure out how the ALU works to be able to figure out "how" the jumpC instruction works.
- Actually this is not that hard, it is just the carry out of the last bit of the "adder", if we only knew what the adder was.
- We could look at Ben's schematic about 1/8 of the way down the page.
- He seems to have the a register hooked into to 74283 chips.
- And the b register is hooked in through a series of xor chips.
- The carry bit is set from the 4th carry out of the top chip.
-
- Let's look at the 74283.
- The datasheet
- This is a 4 bit adder.
- There are 4 A inputs (A1- A4)
- 4 b inputs (B1-B4)
- A carry in (C0)
- 4 sum outputs (Σ1 - Σ4)
- A carry out (c4)
- A positive voltage
- A ground
- We can hook up a version in digital
- Half of Eater's ALU
- Could we build the adder ourselves?
- We start with a 1 bit adder.
a | b | cin | cout | sum |
0 | 0 | 0 | 0 | 0 |
0 | 0 | 1 | 0 | 1 |
0 | 1 | 0 | 0 | 1 |
0 | 1 | 1 | 1 | 0 |
1 | 0 | 0 | 0 | 1 |
1 | 0 | 1 | 1 | 0 |
1 | 1 | 0 | 1 | 0 |
1 | 1 | 1 | 1 | 1 |
- optimize f=Σm(3,5,6,7)
- optimize f=Σm(1,2,4,7)
- Turn this into a circuit.
- Build a 4 bit ripple carry adder.
- A Multiplexer
- Discussed in 4.3 of Carpanelli
- Has one output line
- Has n control lines
- Has 2n input lines, numbered 0 to 2n-1
- The n control lines select between the input lines
- Sometimes there is an enable port
- A component in Digital
- Multiple but 74153
- 74153 datasheet.
- We can build one with the ideas that a·1 = a, a+0 = a
- Note that to subtract we flip the bits (inverters) and add 1
- We can handle the add one with a carry in of 1.
- Thus the 8-bit ALU
- Input
- A - an 8 bit data source
- B - an 8 bit data source
- Subtract - a 1 bit, 0 indicates add, 1 indicates subtract
- Output
- Sum the sum
- Cout the carry out of the last bit.
- Build this.
- But that still doesn't answer the question, when is the carry out bit set?