Part 2/4
^: Such as the combinational gates you just looked at
Conversion steps:
Example:
| Division by |
Quotient | Remainder | Bit # |
|---|---|---|---|
So
Example:
Find the decimal value of
| binary number: | 1 | 1 | 1 | 0 | 0 | 1 |
|---|---|---|---|---|---|---|
| power of 2: | 2^5 | 2^4 | 2^3 | 2^2 | 2^1 | 2^0 |
Part 3/4
| A | B | Output (A+B) | C S |
|---|---|---|---|
| 0 | 0 | 0 | 0 0 |
| 0 | 1 | 1 | 0 1 |
| 1 | 0 | 1 | 0 1 |
| 1 | 1 | 2 | 1 0 |
For now, we only add two digits without a carry forward number
You need one AND gate and XOR gate to get this output
| A | B | C S |
|---|---|---|
| 0 | 0 | 0 0 |
| 0 | 1 | 0 1 |
| 1 | 0 | 0 1 |
| 1 | 1 | 1 0 |
| A | B | C | C (Carry) | S (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 |
^This is the most complex circuit we will look at
Calculate:
Binary:
^We do not cover subtractors in this course
Part 3/4
The ALU combines multiple full adders and additional logic circuits to perform arithmetic and logical operations (AND, OR, XOR and even more)
| Opcode | Instruction |
|---|---|
| 0000 | A AND B |
| 0001 | A OR B |
| 0010 | A XOR B |
| 0010 | NOT A |
| 0100 | ADD A+B |
| 0101 | SUB A-B |
(Or anything that requires more than one instruction)
Part 3/4
The control unit receives instructions from memory and controls the flow of data within the CPU
It interprets opcode (operation code) to determine the operation to be performed by the ALU or memory
Instruction sets are collections of binary-coded instructions that a computer's CPU can execute
These instructions represent specific operations like arithmetic, memory access, and control flow
There are two main types: RISC with simple instructions for faster execution and CISC with more complex instructions to reduce program size
Different processors use specific instruction sets optimized for various applications and performance requirements
| Intruction | Opcode | Memory Location | Description |
|---|---|---|---|
| ADD | 0 0 0 1 | 2* 2-bit register ID | Add two numbers^ |
| AND | 0 0 1 0 | 2* 2-bit register ID | Add operation |
| LOAD_A | 0 1 1 0 | 4-bit memory address | Load memory address in register A |
| LOAD_B | 0 1 1 1 | 4-bit memory address | Load memory address in register B |
| STORE_B | 1 0 1 1 | 4-bit memory address | Write register A into memory address |
| HALT | 0 1 0 0 | N/A | Halt the program |
[^Result is stored in the second register]
Program to add two numbers
LOAD_A + address 1 -> 0110 1110LOAD_B + address 2 -> 0111 1111Add opcode + 2 register IDs -> 0001 01 10STORE_B + memory address -> 1011 1101HALT -> 0100Congratulations! You just wrote your first program in machine language (code)
0110 1110
0111 1111
0001 01 10
1011 1101
0100
Machine language consists of binary instructions (1s and 0s) that the CPU can directly execute
Each instruction is represented by an opcode, specifying the operation, and memory addresses for data access
Very difficult for humans to work with machine code! -> Use abstraction - high level programming languages such as C, C++ and Java
Part 4/4


A large printed circuit board with numerous wires and various microchips, components, sockets, ports, slots, headers, and connectors.




CPU cooler includes a pump, tubes, radiator, and fans to dissipate heat generated by the CPU.
The liquid circulates through the system, transferring heat to the radiator, and then the fans cool the liquid.

Part 4/4



The arrow on the emmitor points in the direction of conventional current flow which is opposite of actual electron flow due to a historical convention.
Mooreβs Law: The number of transistors in a dense integrated circuit (IC) doubles about every two years.
RAM and Register memory is volatile, do not store anything important there! More on this in the later half of this lecture.