1.
Digital Concepts, Logic Gates and
12/2/2022
Boolean Algebra
i. Introduction
DIGITAL LOGIC DESIGN [ECENG 3101] LEC. 1
ii. Digital Vs. Analogue
iii. Binary Digits and Basic Logic Operations
iv. Number Systems and Operations
2
1. Digital Concepts, Logic Gates and Boolean
12/2/2022
Algebra
Digital Electronics is a field of electronics deals about the
study of digital signals and the engineering of devices that use
DIGITAL LOGIC DESIGN [ECENG 3101] LEC. 1
or produce them.
𝑓 𝑡 = 𝑎𝑡 2 + 𝑏𝑡 + 𝑐
• The electronic circuits which are used to process such signals
are called analog circuits and Digital Circuits respectively.
• This is in contrast to analog electronics and analog signals.
3
1. Digital Concepts, Logic Gates and Boolean
12/2/2022
Algebra
Analogue Signal Digital Signals
DIGITAL LOGIC DESIGN [ECENG 3101] LEC. 1
• Continuous Quantity • Discrete set of values
with the help of the
in nature switches
• Intensity of Light • 5v represents logic high or
• Temperature logic 1
• 0v represents logic low or
• Velocity logic 0
• Signals usually have a • Distinct discrete levels
continuous value or values HIGH/LOW,
ON/OFF
• Systems based on • Systems based on
analogic circuit digital circuit 4
1. Digital Concepts, Logic Gates and Boolean
12/2/2022
Algebra
Analogue Signal Digital Signal
DIGITAL LOGIC DESIGN [ECENG 3101] LEC. 1
5
1. Digital Concepts, Logic Gates and Boolean
12/2/2022
Algebra
Digital systems : use electronic circuitry that only
DIGITAL LOGIC DESIGN [ECENG 3101] LEC. 1
works with two voltage levels represent two states.
• A voltage level of 5v represents logic high or logic 1
state and a voltage level of 0v represents logic low or
logic 0 state.
• The two states in a digital system can represent any
two quantities,
• On/Off
• Black/White
• Hot/Cold
• Stationary/Moving
6
1. Digital Concepts, Logic Gates and Boolean
12/2/2022
Algebra
Advantages of Digital Systems
DIGITAL LOGIC DESIGN [ECENG 3101] LEC. 1
• Efficient Processing & Data Storage
• Efficient & Reliable Transmission
• Detection and Correction of Errors
• Precise & Accurate Reproduction
• Easy Design and Implementation
• Occupy minimum space
7
1. Digital Concepts, Logic Gates and Boolean
12/2/2022
Algebra
ii. Binary Digits
DIGITAL LOGIC DESIGN [ECENG 3101] LEC. 1
• The two states of the Digital circuits are based on the
Binary number system which allows only two numbers 0
and 1.
• The Binary digit is called a bit.
• To represent more than two states a combination of
binary bits is used.
• A temp of 39 is represented by a combination of six bits
100111.
• The number 39 is represented in a digital system by a 8
combination of voltage levels 5, 0, 0, 5, 5 and 5 volts
1. Digital Concepts, Logic Gates and Boolean
12/2/2022
Algebra
iii. Number Systems and Operations
• Representation of numerical data
DIGITAL LOGIC DESIGN [ECENG 3101] LEC. 1
• Decimal Number System
• Binary Number System
• Hexadecimal Number System
• Octal Number System
• Caveman Number System
9
1. Digital Concepts, Logic Gates and Boolean
12/2/2022
Algebra
iii. Common Number Systems
DIGITAL LOGIC DESIGN [ECENG 3101] LEC. 1
10
1. Digital Concepts, Logic Gates and Boolean
12/2/2022
Algebra
• Caveman Number System Decimal Caveman
Number Number
• ∑, ∆, >, Ω and ↑
DIGITAL LOGIC DESIGN [ECENG 3101] LEC. 1
0 ∑
• Base – 5 Number System
1 ∆
• ∆Ω↑∑ = ?
2 >
3 Ω
4 ↑
5 ∆∑
6 ∆∆
7 ∆>
8 ∆Ω
9 ∆↑ 11
10 >∑
1. Digital Concepts, Logic Gates and Boolean
12/2/2022
Algebra
• Basic Operation in number system
• Conversion of bases
DIGITAL LOGIC DESIGN [ECENG 3101] LEC. 1
• Complements
• Arithmetic operation
12
1. Digital Concepts, Logic Gates and Boolean
12/2/2022
Algebra
• Conversion of bases
• Decimal - to - Binary Conversion
DIGITAL LOGIC DESIGN [ECENG 3101] LEC. 1
• Decimal - to - Octal Conversion
• Decimal - to - Hexadecimal Conversion
• Examples:
1. Convert 2610 into a binary number.
2. Convert 42610 into an octal number.
3. Convert 34810 into a hexadecimal number.
13
1. Digital Concepts, Logic Gates and Boolean
12/2/2022
Algebra
• Base conversion with fraction
1. Convert 25.62510 into a binary number system.
DIGITAL LOGIC DESIGN [ECENG 3101] LEC. 1
2. Convert 34.52510 into a octal number system.
3. Convert 92.8510 into a hexadecimal number system.
14
1. Digital Concepts, Logic Gates and Boolean
12/2/2022
Algebra
Inter-Base Conversion
DIGITAL LOGIC DESIGN [ECENG 3101] LEC. 1
1. Conversion from a Binary to Octal Number and Vice Versa
2. Conversion from a Binary to Hexadecimal Number and Vice
Versa
3. Conversion from an Octal to Hexadecimal Number and Vice
Versa
15
1. Digital Concepts, Logic Gates and Boolean
12/2/2022
Algebra
Home Work
1. Convert 1011010102 into an equivalent octal number.
DIGITAL LOGIC DESIGN [ECENG 3101] LEC. 1
2. Convert 2358 into an equivalent binary number.
3. Convert 110101102 into an equivalent hexadecimal number.
4. Convert 29C16 into an equivalent binary number
5. Convert A34F16 into an equivalent octal number
16
1. Digital Concepts, Logic Gates and Boolean
12/2/2022
Algebra
COMPLEMENTS
• Simplifying the subtraction operation and for logical
DIGITAL LOGIC DESIGN [ECENG 3101] LEC. 1
manipulations
• For each number system of base – r.
1. r’s complement
2. (r – 1)’s complement
17
1. Digital Concepts, Logic Gates and Boolean
12/2/2022
Algebra
The r’s Complement
• If a positive number N is given in base r with an integer part of
DIGITAL LOGIC DESIGN [ECENG 3101] LEC. 1
n digits, the r’s complement of N is given as 𝑟𝑛 – 𝑁 for 𝑁 ≠ 0
and 0 for 𝑁 = 0.
Examples:
• What is 10’s complement of (23450)10
• What is 2’s complement of (10110)2
• What 10’s complement of (23.324)10
18
1. Digital Concepts, Logic Gates and Boolean
12/2/2022
Algebra
The (r–1)’s Complement
• If a positive number N is given in base r with an integer part of
DIGITAL LOGIC DESIGN [ECENG 3101] LEC. 1
n digits and a fraction part of m digits, then the (r– 1)’s
complement of N is given as(𝑟 𝑛 – 𝑟 −𝑚 – 𝑁) for 𝑁 ≠ 0 and 0 for
N= 0.
• Home Exercise:
• What is 9’s complement of (23450)10
• What is 1’s complement of (10110.1011)2
• What 9’s complement of (23.324)10
19
1. Digital Concepts, Logic Gates and Boolean
12/2/2022
Algebra
Binary Arithmetic Operation
1. Binary Addition
DIGITAL LOGIC DESIGN [ECENG 3101] LEC. 1
2. Binary Subtraction
3. Binary Multiplication
4. Binary Division
20
1. Digital Concepts, Logic Gates and Boolean
12/2/2022
Algebra
Binary Addition
• Four Basic rules for binary multiplication
DIGITAL LOGIC DESIGN [ECENG 3101] LEC. 1
1st digit 2nd digit Sum Carry
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
21
1. Digital Concepts, Logic Gates and Boolean
12/2/2022
Algebra
Addition of multiple binary numbers
DIGITAL LOGIC DESIGN [ECENG 3101] LEC. 1
Carry 1 10 1
1st Number 1 0 1 1
2nd Number 1 1 0
3rd Number 1 0 0 0
4th Number 1 1
22
Result 1 1 1 0 0
1. Digital Concepts, Logic Gates and Boolean
12/2/2022
Algebra
Binary Subtraction
• Four Basic rules for binary subtraction
DIGITAL LOGIC DESIGN [ECENG 3101] LEC. 1
1st digit 2nd digit Difference Borrow
0 0 0 0
0 1 1 1
1 0 1 0
1 1 0 0
23
1. Digital Concepts, Logic Gates and Boolean
12/2/2022
Algebra
• Binary Subtraction of two binary numbers
DIGITAL LOGIC DESIGN [ECENG 3101] LEC. 1
Borrow 1
1st Number 1 0 1 1
2nd Number 1 1 0
Result 1 0 1
24
1. Digital Concepts, Logic Gates and Boolean
12/2/2022
Algebra
Binary Multiplication
• Four Basic rules for binary multiplication
DIGITAL LOGIC DESIGN [ECENG 3101] LEC. 1
1st digit 2nd digit Product
0 0 0
0 1 0
1 0 0
1 1 1
25
1. Digital Concepts, Logic Gates and Boolean
12/2/2022
Algebra
Binary Multiplication
1101 (13)
DIGITAL LOGIC DESIGN [ECENG 3101] LEC. 1
x 101 (5)
1st product term 1101
2nd product term 0000
3rd product term 1101
Product 1000001 (65)
26
1. Digital Concepts, Logic Gates and Boolean
12/2/2022
Algebra
Multiplication by shifting left
• Decimal 29 shifted left by one digit
DIGITAL LOGIC DESIGN [ECENG 3101] LEC. 1
=290
• Shift left 1 digit is multiply by 10
• Binary 111012 (29) shifted left by one bit
=1110102 (58)
• Shift left 1 bit is multiply by 2
27
1. Digital Concepts, Logic Gates and Boolean
12/2/2022
Algebra
Binary Division
• Four Basic rules for binary Division
DIGITAL LOGIC DESIGN [ECENG 3101] LEC. 1
1st digit 2nd digit Division
0 0 Undefined
0 1 0
1 0 Undefined
1 1 1
28
1. Digital Concepts, Logic Gates and Boolean
12/2/2022
Algebra
Division by shifting right
• Decimal 29 shifted right by one digit
DIGITAL LOGIC DESIGN [ECENG 3101] LEC. 1
=2.9
• Shift left 1 digit is divide by 10
• Binary 111012 (29) shifted left by one bit
=1110.12 (14.5)
• Shift left 1 bit is divide by 2
29
1. Digital Concepts, Logic Gates and Boolean
12/2/2022
Algebra
Home Works:
1. Briefly discuss the arithmetic operation for octal number
DIGITAL LOGIC DESIGN [ECENG 3101] LEC. 1
system with examples.
2. Briefly discuss the arithmetic operation for hexadecimal
number system with examples.
30
1. Digital Concepts, Logic Gates and Boolean
12/2/2022
Algebra
Representation of binary number system
• Signed binary numbers
DIGITAL LOGIC DESIGN [ECENG 3101] LEC. 1
• Unsigned numbers
• 2’s complement
• In Signed binary, to handle positive and negative binary
numbers
• MSB set to 1 indicates a negative number
• MSB set to 0 indicates a positive number
31
1. Digital Concepts, Logic Gates and Boolean
12/2/2022
Algebra
• Range of Signed binary numbers
DIGITAL LOGIC DESIGN [ECENG 3101] LEC. 1
Decimal Sign Magnitude 2’s Complement Unsigned
Number 2n-1, 2n-1 -1 2n-1, 2n-1 -1 2n , 2n - 1
0 0000 0000 000
1 0001 0001 001
2 0010 0010 010
3 0011 0011 011
4 0100 0100 100
5 0101 0101 101
32
6 0110 0110 110
7 0111 0111 111
1. Digital Concepts, Logic Gates and Boolean
12/2/2022
Algebra
• Range of Signed binary numbers
DIGITAL LOGIC DESIGN [ECENG 3101] LEC. 1
Decimal Sign Magnitude 2’s Complement Unsigned
Number 2n-1-1, -(2n-1 -1) 2n-1, -2n-1
-8 1000
-7 1111 1001
-6 1110 1010
-5 1101 1011
-4 1100 1100
-3 1011 1101
-2 1010 1110 33
-1 1001 1111
1. Digital Concepts, Logic Gates and Boolean
12/2/2022
Algebra
Exercise: Compute addition and subtraction for the following
signed binary numbers with both 1’s and 2’s
DIGITAL LOGIC DESIGN [ECENG 3101] LEC. 1
complement method
A. [0101]2 + [0010]2
B. [0101]2 + [1010]2
C. [1101]2 + [0010]2
D. [1101]2 + [1010]2
34
1. Digital Concepts, Logic Gates and Boolean
12/2/2022
Algebra
Computer Codes
• Symbols for representing information
DIGITAL LOGIC DESIGN [ECENG 3101] LEC. 1
• Example: Traffic Light System
• Red light = Stop
• Yellow light = Caution and
• Green light = Go
• There are various types of code in digital computer
system
• Numeric Code
• Character Code, and
• Error Detection and Correction Code 35
1. Digital Concepts, Logic Gates and Boolean
12/2/2022
Algebra
Numeric Code
• Represent numbers for processing and/or storage
DIGITAL LOGIC DESIGN [ECENG 3101] LEC. 1
• Fixed point number
• Floating point numbers
Character Codes
• American Standard Code for Information Interchange (ASCII)
or Extended Binary Coded Decimal Interchange Code
(EBCDIC)
• BCD code
• Gray codes
• Excess-K codes
36
1. Digital Concepts, Logic Gates and Boolean
12/2/2022
Algebra
Error detection and Correction codes
• Parity code
DIGITAL LOGIC DESIGN [ECENG 3101] LEC. 1
• Two-out -of-five Code
• Hamming code
37
1. Digital Concepts, Logic Gates and Boolean
12/2/2022
Algebra
Home Take Exam 1.
1. Discuss briefly the following computer codes
DIGITAL LOGIC DESIGN [ECENG 3101] LEC. 1
a) Numeric Codes
b) Alphanumeric Codes
c) Error Correction and Detection Codes
2. What are the basic differences between ASCII and EBCDIC
Codes
3. Write your Full Name using ASCII Codes
38