CS 1 Worksheet
3 – Boolean Logic and Logic Gates
4 – Binary Numbers
BIT
•Bit (Binary Digit) = Basic unit of information, ______
. ______The smallest unit of information within the computer.
•The only thing a computer understands.
•Abbreviation: b
•Bit has one of two values:
–______
–______
•Bits are really only symbols.
•Used to display the one of two different, discrete states.
•Bits are used as:
–______
•Numbers
•Text characters
•Images
•Sound
•Etc.
–______
Boolean Operations
•Integrated Circuits (microchips) are used to store and manipulate (process) bits.
•This is done using Boolean operations (in honor of mathematician George Boole, 1815-1864).
•______: An operation that manipulates one or more true/false values
•Specific operations
–AND
–OR
–XOR (exclusive or)
–NOT
•Using ______we can uses different sets of logic operations to store, add, subtract, and more complicated operations with bit.
•Truth tables (simple ones)
•______ operation
–______
–Kermit is a frog AND Miss Piggy is an actress
–Inputs to AND operation represent truth of falseness of the compund statement.
•Gate:
–A device that ______
–A device that produces the output of a Boolean operation when given the operation’s input values.
•Gates can be:
–Gears
–Relays
–Optic devices
–______(microchips)
Boolean Operations – AND Gate
0 = FALSE
1 = TRUE
AND operation
•Both input values must be TRUE for output to be TRUE
Boolean Operations – OR Gate
0 = FALSE
1 = TRUE
_____ operation
- ______
Boolean Operations – XOR Gate
_____ operation
- ______
Boolean Operations – NOT Gate
_____ operation
- ______
- ______
Binary Math
•All digits start with _____
•A Base-n number system has n number of digits:
–Decimal: ______has ______
–Binary: ______has ______
–Hexadecimal: ______has ______
•The ______is always the number of ______
•Each of the following columns is n times the previous column (n = Base-n)
–Base 10: 10,000 1,000 100 10 1
–Base 2: 16 8 4 2 1
–Base 16: 65,536 4,096 256 16 1
Base 2 (Binary) Number System
Digits (2): ______
Binary Math - Addition
Half Adder Gate – Adding two bits
ASCII-7
•In the early days, a ______was used, with ______of 0’s and 1’s, enough for a typical keyboard.
•The standard was developed by ______(American Standard Code for Information Interchange)
•Each group of 7 bits was mapped to a single keyboard character.
Byte = ______
•More common: 8 bits = 1 byte
•Abbreviation: ____
1 byte (B)
Kilobyte (KB) = 1,024 bytes (210)
•“one ______bytes”
1,024 = 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2
Megabyte (MB) = 1,048,576 bytes (220)
•“one ______bytes”
Gigabyte (GB) = 1,073,741,824 bytes (230)
•“one ______bytes”
ASCII-8
•IBM later extended the standard, using 8 ______
•This was known as ______
•This gave ______unique combinations of 0’s and 1’s.
Unicode
•Although ASCII works fine for English, many other languages need more than 256 characters, including numbers and punctuation.
•Unicode uses a 16 bit representation, with 65,536 possible symbols.
•Unicode can handle all languages.
•
CS 1 – Digital Logic and Binary Numbers Name: ______
Answer Sheet
Answer 0 (off) or 1 (on) for the following: (5 points each)
1A: ______1B: ______1C: ______1D: ______
2A: ______2B: ______2C: ______2D: ______
3A: ______3B: ______3C: ______3D: ______
Problems 1A through 1D (5 points each)
1A / 1 (on) or 0(off)?1
0 /
1B
0
1 /
1C
0
1 /
1D
1
0
0
1 /
Problems 2A through 2D (5 points each)
2A / 1 (on) or 0(off)?1
1 /
2B
1
0 /
2C
1
0 /
2D
1
1
1
0 /
Problems 3A through 3D (5 points each)
3A / 1 (on) or 0(off)?1
1 /
3B / NOTE: Igore the lightbulb. This is a “1” (ON) bit.
1 /
3C
1
0 /
3D
1
1
1 /
1