ENGR 303 – Introduction to Logic Design Lecture 1
Dr. Chuck BrownEngineering and Computer Information Science
Folsom Lake College
<2>
• Objective of the course
• Course Material / Policies
• Course Outline
• Number Systems
• Logic Gates
Outline for Todays Lecture
ENGR 303
<3> ENGR 303
Examples of Digital Logic Design
• Digital Logic is the basis of electronic systems, such as computers, cell phones, and numerous other high-tech systems.
• Digital Logic is rooted in binary code, a series of zeroes and ones each having an opposite value.
• Digital Logic facilitates computing, robotics and other electronic applications.
• Digital Logic Design is used to develop hardware, such as circuit boards and microchip processors.
<4>
• Identify common digital components such as – logic gates, flip-flops, counters, registers, state
machines, and programmable logic devices (PLDs)
• Analyze a digital design problem using – combinational logic, binary number system,
conversion between number systems, Boolean algebra, and Karnaugh maps.
• Design and build a digital logic system including– combinatorial logic, sequential state machines and
basic computer micro-architecture elements using schematic entry and Verilog or VHDL design tools
Objective of Course
ENGR 303
<5>
• Text Book:
– Digital Design and Computer Architecture, Second Edition– August 7, 2012, by David Harris and Sarah Harris ISBN-13: 978-0123944245
• Altera Quartus II version 181 design software will be available for download
– https://www.flc.losrios.edu/about-us/faculty-and-staff-directory/dr-chuck-brown
– Quartus is also available via remote access to FLC lab
Course Material
ENGR 303
<6>
• Prerequisites: – Apply algebra concepts in a problem-solving setting
– Manipulate algebraic expressions and solve simple algebraic equations
– Some previous exposure to a programming language and be able to interpret and modify supplied hardware descriptive language code segments
• Grading:– Problem Sets / Quizes (15%)
– Lab Assignments (45 %)
– Midterm (20 %) and Final Exam (20 %)
Course Policies
ENGR 303
<7>
• Lab handout is available on Canvas
• Lab report
– one lab report per lab is due typically one session
after the completion of each lab
• Save all your work to your H: drive
Lab Policies
ENGR 303
<8>
• Number systems, logic gates, combinatorial logic, Boolean equations, Karnaugh maps
• Digital Building blocks - multiplexers, decoders, adder, multipliers
• Sequential logic - latches, flip-flops, registers, counters, finite state machines
• Hardware Descriptive Language and FPGA implementation
• Computer microarchitecture – data path, ALU, instruction decoder
Class Outline
ENGR 303
<9>
• Breaking the details
into more manageable
parts
focu
s o
f th
is c
ou
rse
programs
device drivers
instructions
registers
datapaths
controllers
adders
memories
AND gates
NOT gates
amplifiers
filters
transistors
diodes
electrons
Abstraction
ENGR 303
<10>
• Most physical variables are continuous
– Voltage on a wire
– Frequency of an oscillation
– Position of a mass
• Digital abstraction considers discrete
subset of values
– Hi or Lo
– On or Off
The Digital Abstraction
ENGR 303
<11>
• Two discrete values:
– 1’s and 0’s
– 1, TRUE, HIGH
– 0, FALSE, LOW
• 1 and 0: voltage levels, rotating gears, fluid levels, etc.
• Digital circuits use voltage levels to represent 1 and 0
• Bit: Binary digit
Digital Discipline: Binary Values
ENGR 303
<12>
• Born to working class parents
• Taught himself mathematics and
joined the faculty of Queen’s
College in Ireland
• Wrote An Investigation of the Laws
of Thought (1854)
• Introduced binary variables
• Introduced the three fundamental
logic operations: AND, OR, and
NOT
George Boole, 1815-1864
ENGR 303
<13>
537410
=
10
's c
olu
mn
10
0's
co
lum
n
10
00
's c
olu
mn
1's
co
lum
n
11012 =
2's
co
lum
n
4's
co
lum
n
8's
co
lum
n
1's
co
lum
n
• Decimal numbers, base = 10
• Binary numbers, base = 2
Number Systems
ENGR 303
<14>
537410
= 5 × 103 + 3 × 102 + 7 × 101 + 4 × 100
five
thousands
10
's c
olu
mn
10
0's
co
lum
n
10
00
's c
olu
mn
three
hundreds
seven
tens
four
ones
1's
co
lum
n
11012 = 1 × 23 + 1 × 22 + 0 × 21 + 1 × 20 = 13
10one
eight
2's
co
lum
n
4's
co
lum
n
8's
co
lum
n
one
four
no
two
one
one1
's c
olu
mn
• Decimal numbers, base = 10
• Binary numbers, base = 2
Number Systems
ENGR 303
<15>
• 20 = 1
• 21 = 2
• 22 = 4
• 23 = 8
• 24 = 16
• 25 = 32
• 26 = 64
• 27 = 128
• 28 = 256
• 29 = 512
• 210 = 1024
• 211 = 2048
• 212 = 4096
• 213 = 8192
• 214 = 16384
• 215 = 32768
ENGR 303
International Electrotechnical Commission Standard… Binary Powers of Two
<16> ENGR 303
GigaByte vs. GibiByteInternational Electrotechnical Commission standard:kibi = 210, Mebi = 220, Gibi 230, etc. are binary based
1 GibiByte = 230 bytes = 1.073741824 x 109 Gib
International System of Quantities:kilo = 103, Mega = 106), Giga = 109), etc. are decimal based
1 GigaByte = 1 x 109 GB
Aside: Storage is marketed in GB, although Windows OS sees GiB
128GB Drive; Windows displays as 119.2 GB (actual GiB)
<17>
• Decimal to binary conversion:– Convert 100112 to decimal
• Decimal to binary conversion:– Convert 4710 to binary
Number Conversion
ENGR 303
<18>
• Decimal to binary conversion:– Convert 100112 to decimal
– 16×1 + 8×0 + 4×0 + 2×1 + 1×1 = 1910
• Decimal to binary conversion:– Convert 4710 to binary
– 32×1 + 16×0 + 8×1 + 4×1 + 2×1 + 1×1 = 1011112
Number Conversion
ENGR 303
<19>
• N-digit decimal number – How many values? – Range? – Example: 3-digit decimal number:
• N-bit binary number– How many values? – Range:– Example: 3-digit binary number:
Binary Values and Range
ENGR 303
<20>
• N-digit decimal number – How many values? 10N
– Range? [0, 10N - 1]– Example: 3-digit decimal number:
• 103 = 1000 possible values• Range: [0, 999]
• N-bit binary number– How many values? 2N
– Range: [0, 2N - 1]– Example: 3-digit binary number:
• 23 = 8 possible values• Range: [0, 7] = [0002 to 1112]
Binary Values and Range
ENGR 303
<21>
Hex Digit Decimal Equivalent Binary Equivalent
0 0 0000
1 1 0001
2 2 0010
3 3 0011
4 4 0100
5 5 0101
6 6 0110
7 7 0111
8 8 1000
9 9 1001
A 10 1010
B 11 1011
C 12 1100
D 13 1101
E 14 1110
F 15 1111
Hexadecimal Numbers – Base 16
ENGR 303
<22>
• Hexadecimal to binary conversion:– Convert 4AF16 (also written 0x4AF) to binary
• Hexadecimal to decimal conversion:– Convert 0x4AF to decimal
Hexadecimal to Binary Conversion
ENGR 303
<23>
• Hexadecimal to binary conversion:– Convert 4AF16 (also written 0x4AF) to binary
– 0100 1010 11112
• Hexadecimal to decimal conversion:– Convert 4AF16 to decimal
– 162×4 + 161×10 + 160×15 = 119910
Hexadecimal to Binary Conversion
ENGR 303
<24>
• Bits
• Bytes & Nibbles
• Bytes in HEX
10010110nibble
byte
CEBF9AD7least
significant
byte
most
significant
byte
10010110least
significant
bit
most
significant
bit
Bits, Bytes, Nibbles…
ENGR 303
<25>
• Logic functions: – 3 basic logic functions:
• NOT (inverter or complement), AND, OR
– Combine NOT with AND, OR to get • NAND, NOR
– Combine to get special operations • XOR, XNOR
• Single-input: – NOT gate, buffer
• Two or more inputs: – AND, OR, NAND, NOR, XOR, XNOR
Logic Gates
ENGR 303
<26> ENGR 303
Truth Table
• A chart that shows the truth value of every
possible combination of all inputs of a logic
expression
• 2n rows for n input variable
• Example: 2-input AND function Y = AB
A B Y
0 0 0
0 1 0
1 0 0
1 1 1
<27>
NOT
Y = A
A Y0
1
A Y
BUF
Y = A
A Y0
1
A Y
Single-Input Logic Gates
ENGR 303
<28>
NOT
Y = A
A Y0 1
1 0
A Y
BUF
Y = A
A Y0 0
1 1
A Y
Single-Input Logic Gates
ENGR 303
Verilog Assign Y = ~A;or
not (y,a);
Assign Y = A;or
buf (y,a);
<29>
AND
Y = AB
A B Y0 0
0 1
1 0
1 1
AB
Y
OR
Y = A + B
A B Y0 0
0 1
1 0
1 1
AB
Y
Two-Input Logic Gates
ENGR 303
<30>
AND
Y = AB
A B Y0 0 0
0 1 0
1 0 0
1 1 1
AB
Y
OR
Y = A + B
A B Y0 0 0
0 1 1
1 0 1
1 1 1
AB
Y
Two-Input Logic Gates
ENGR 303
“Any Ones”“All Ones”
Verilog Assign Y = A & B;or
and (Y, A, B);
Assign Y = A | B;or
or (Y, A, B);
<31>
XNOR
Y = A + B
A B Y0 0
0 1
1 0
1 1
AB
Y
XOR NAND NOR
Y = A + B Y = AB Y = A + B
A B Y0 0
0 1
1 0
1 1
A B Y0 0
0 1
1 0
1 1
A B Y0 0
0 1
1 0
1 1
AB
YAB
YAB
Y
More Two-Input Logic Gates
ENGR 303
<32>
XNOR
Y = A + B
A B Y0 0
0 1
1 0
1 1
AB
Y
XOR NAND NOR
Y = A + B Y = AB Y = A + B
A B Y0 0 0
0 1 1
1 0 1
1 1 0
A B Y0 0 1
0 1 1
1 0 1
1 1 0
A B Y0 0 1
0 1 0
1 0 0
1 1 0
AB
YAB
YAB
Y
1
0
0
1
More Two-Input Logic Gates
ENGR 303
“Even Number Ones”“Odd Number Ones” “Not Zeros”“Not Ones”
Verilog Assign Y = A ^ B;or
xor (Y, A, B);
Assign Y = A ~& B;or
nand (Y, A, B);
Assign Y = A ~| B;or
nor (Y, A, B);
Assign Y = A ~^ B;or
xnor (Y, A, B);
<33>
NOR3
Y = A+B+C
B C Y0 0
0 1
1 0
1 1
AB YC
A0
0
0
0
0 0
0 1
1 0
1 1
1
1
1
1
Multiple-Input Logic Gates
AND3
Y = ABC
AB YC
B C Y0 0
0 1
1 0
1 1
A0
0
0
0
0 0
0 1
1 0
1 1
1
1
1
1
ENGR 303
<34>
NOR3
Y = A+B+C
B C Y0 0
0 1
1 0
1 1
AB YC
A0
0
0
0
0 0
0 1
1 0
1 1
1
1
1
1
1
0
0
0
0
0
0
0
Multi-input XOR: Odd parity generator
Multiple-Input Logic GatesAND3
Y = ABC
AB YC
B C Y0 0
0 1
1 0
1 1
A0
0
0
0
0 0
0 1
1 0
1 1
1
1
1
1
0
0
0
0
0
0
0
1
ENGR 303
Verilog Assign Y = A & B & C;or
and (Y, A, B, C);
Assign Y = ~( A | B | C );or
nor (Y, A, B, C);