

































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Bits, Building Block, Logic Gates, AND OR XOR Gates, Base-2 Addition, Column Adder, Level of Abstraction
Typology: Study notes
1 / 41
This page cannot be seen from the preview
Don't miss anything!


































When we compute, we operate on discrete / digital values. Examples of digital machines:
What is the most important part of your computer? Your computer's processor (CPU) What companies manufacture CPUs? Intel, AMD, etc. The processor is the computer's brain. It's what runs your programs.
Lofty Goal: Learn how processors work. But: Your processor is a complex digital machine. So: Learn how simple digital machines work. Hope: Give you a sense for how some of the things inside your processor work. (This is what ECE majors study.)
... can I represent with 2 bits? 4: 00, 01, 10, 11 ... can I represent with 3 bits? 8: 000, 001, 010, 011, 100, 101, 110, 111 ... can I represent with n bits? 2 n
... to represent 3 possible values? 2 ... to represent 6 possible values? 3 ... to represent 20 possible values? 5
Lower voltage = "0" Higher voltage = "1" Each wire carries a single bit. We can literally determine whether a wire is carrying a "0" or a "1" by measuring the voltage on that wire.
A NOT Machine Its Truth Table 1 0 0 IN OUT 1 NOT IN OUT 0 = false 1 = true
An OR Machine Its Truth Table 0 1 1 1 0 B OUT 1 0 A 0 0 1 1 1 B A OUT OR
These 3 machines are referred to as logic gates. An AND machine (for example) is referred to as an AND gate.
The robot is happy if leftHasWall() or rightHasWall() , but not both. lonely claustrophobic happy happy
public static boolean isHappy() { return _______________________ _______________________; } (leftHasWall() &&! rightHasWall()) || (! leftHasWall() && rightHasWall())
AND OUT OR NOT NOT AND A B
Once we defined turnRight to mean Robot.turnLeft(); Robot.turnLeft(); Robot.turnLeft(); we could now think of turnRight as one of our building blocks. This idea is called Abstraction.