Peter Mawhorter
When you press the power button, electricity flows through a bunch of transistors. This feeds power to things like a keyboard & monitor, which send inputs into or receive outputs from the transistors.
The transistors are organized into logic gates, like AND and OR.
The schematic diagram of the full CPU.
The CPU connections listed as a table:
| Component | Inputs | Outputs |
|---|---|---|
| PC |
|
|
| Instruction Memory |
|
|
| Control Unit |
|
|
| Register File |
|
|
| Arithmetic Logic Unit (ALU) |
|
|
| Data Memory (RAM) |
|
|
| BEQ Logic |
|
|
cs240 script or git?0x prefix is often used, e.g.,
0xF83AFF in hexHow to represent negative numbers using bits?
Wires may be “buses:” check ‘bit width’ of components
What combinational function is this?
has 3 bits set, so the parity bit would 1
has 2 bits set, so the parity bit would 0
| A | B | P |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
& bitwise AND
| bitwise OR
^ bitwise XOR
~ bitwise NOT
! logical NOT: anything other
than 0 gives 0, 0 gives 1.
X << Y left-shift: shift
bit-pattern of X left by Y bits.
X >> Y right-shift: shift
bit-pattern of X right by Y bits.
Note: Left-shift adds zeros on right, right-shift adds copies of highest bit on left (or zeroes if unsigned).
Things to try:
& with a mask value like
0x0F)