Chapter 4
Chapter 4
Chapter 4
CHAPTER FOUR
Computer system architecture
Logic elements and Boolean algebra
Logic and bit operations
Computers represent information by bits.
A bit has two possible values, namely zero and one.
This meaning of the word comes from binary digit, since zeroes and ones are the digits used
in binary representations of numbers.
A bit can be used to represent a truth value, since there are two truth values, true and false.
A variable is called a Boolean variable if its values are either true or false.
Computer bit operations correspond to the logical connectives.
What are logic gates?
In the binary lesson, we discussed the switches inside a computer
Logic gates are the switches that turn ON or OFF depending on what the user is doing!
They are the building blocks for how computers work.
Logic gates turn ON when a certain condition is true, and OFF when the condition is false
They check whether or not the information they get follows a certain rule
They either spit out the answer true (ON) or false (OFF)
Remember:
True= ON = 1
False = OFF=0
Types of Logic Gates!
Major logic gates: NOT, AND, OR, and XOR
There are also other ones, such as NAND, NOR, and XNOR.
This is called Boolean logic
In a circuit schematic each logic gate is represented by a different picture, like the ones
shown below.
NOT
NOT is the most simple logic gate.
All it does is take in an input that is either ON or OFF and spits out the opposite.
So for a 1 it will give a 0, and for a 0 it will give a 1.
Another name for a NOT gate is inverter, because it inverts (makes opposite) the input
0 1
1 0
NOT Truth Table
AND
Unlike NOT, AND needs two inputs
It only turns on when both inputs are ON
If only one input is on, it spits out OFF
If both inputs are off, it spits out OFF
The OR gate
2 Input OR gate
A B A+B
0 0 0
0 1 1
1 0 1
1 1 1
OR Truth Table
NAND gate
This is a NOT-AND gate which is equal to an AND gate followed by a NOT gate.
The outputs of all NAND gates are true if any of the inputs are false.
The symbol is an AND gate with a small circle on the output.
The small circle represents inversion.
NOR gate
This is a NOT-OR gate which is equal to OR agate followed by a NOT gate.
The outputs of all NOR gates are false if any of the inputs are true.
The symbol is an OR gate with a small circle on the output.
The small circle represents inversion.z