0% found this document useful (0 votes)
55 views43 pages

12.1 Lecture Notes - ENE3063 (10172) - 20241118

Uploaded by

hijinhui
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views43 pages

12.1 Lecture Notes - ENE3063 (10172) - 20241118

Uploaded by

hijinhui
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 43

Electronic Engineering

Course Number : ENE3063


Class Code : 10172

Min Ku Kim
Department of Mechanical Engineering
Hanyang University

2024.11.18
Chapter 11
Digital Logic Circuits.

• 11.1 Analog and Digital Signals.


• 11.2 The Binary Number System.
• 11.3 Boolean Algebra and Logic Gates.
• 11.4 Karnaugh Maps and Logic Design.
• 11.5 Combination Logic Modules.
Chapter 11
Chapter Learning Objectives.

1. Understand the concepts of analog and digital signals and


of quantization.
2. Convert between decimal and binary number systems and
use hexadecimal system and BCD and Gray codes.
3. Write truth tables, and realize logic functions from truth
tables by using logic gates.
4. Systematically design logic functions using Karnaugh
maps.
5. Study various combinational logic modules, including
multiplexers, memory, and decoder elements, and
programmable logic arrays.
11.2 The Binary Number System
• Binary digits are called Bits.
• Four bits → Nibble.
• Eight bits → Byte.
• Word is the basic unit of data in
a digital system.
• e.g. x86, x64, Arduino
11.2 The Binary Number System
• Decimal numbers are are represented as n10.
• Binary numbers are represented as n2.

101102 = 16 + 0 + 4 + 2 + 0 = 2210

• Fractional numbers are similarly represented.


3.2510 = 3 × 100 + 2 × 10−1 + 5 × 10−2

10.0112 = 1 × 21 + 0 × 20 + 0 × 2−1 + 1 × 2−2 + 1 × 2−3


1 1
= 2 + 0 + 0 + + = 2.3752
4 8
11.2 The Binary Number System
• The operation of addition and subtraction are based on the
same rules as decimals.

Rules for Addition Rules for Subtraction


11.2 The Binary Number System
• The operation of addition and subtraction are based on the
same rules as decimals.
Addition Example

Subtraction Example
11.2 The Binary Number System
Binary Multiplication & Division
• In decimal system multiplication table 102 = 100 entries.
• In binary, there are only 4.

__ × __ = ?
Decimal Binary
0 1
0 0 0
1 0 1
11.2 The Binary Number System
Binary Multiplication & Division
• Division in binary system follows the same rule as decimal.
• Division by zero is not contemplated.
11.2 The Binary Number System
Binary Multiplication & Division

110

Source:ElectronicsHub,Electrical4U
11.2 The Binary Number System
Conversion from Decimal Fraction to Binary Fraction.
• Perform the whole number and fractional part separately.
• Ex: 37.5310 to binary?

100101.10000111101 2 = 37.52978515625 ≈ 37.53

• The precision becomes closer with more bits.


• Infinite number of binary digits may may be required to represent a
decimal number exactly.
• Do all binary numbers need to be infinitely long to exactly represent
a decimal numbers?

11.8125 10 = 1011.11012
13.2 The Binary Number System
Lets talk about precision.
• Single-precision floating-point format (IEEE 754).

𝐹𝑙𝑜𝑎𝑡 = −1𝑆𝑖𝑔𝑛 × 1 + 𝑓𝑟𝑎𝑐𝑡𝑖𝑜𝑛 × 2 𝑒𝑥𝑝𝑜𝑛𝑒𝑛𝑡−𝑏𝑖𝑎𝑠 , 𝑏𝑖𝑎𝑠 = 127

Hidden

• Normally expressed in Hex.

3E200000

Source:Wikipedia
13.2 The Binary Number System
Example: express -3.75 as a floating point number.
• - 3.7510 = -11.112 = -1.111 × 21.
• Bias is 127 so add 127 + 1 = 128 (final exponent + bias).

𝐹𝑙𝑜𝑎𝑡 = −1𝑆𝑖𝑔𝑛 × 1 + 𝑓𝑟𝑎𝑐𝑡𝑖𝑜𝑛 × 2 𝑒𝑥𝑝𝑜𝑛𝑒𝑛𝑡−𝑏𝑖𝑎𝑠


, 𝑏𝑖𝑎𝑠 = 127

1 10000000 11100000000000000000000

Floating Point Ranges.


• For a 32 bit number, 8 bit exponent.
• ±2256 ≈ 1.5 ×1077
• Accuracy.
• The effect of changing the LSB mantissa/fraction.
• 23 bit significand, 2-23 ≈ 1.2 ×10-7, ~ 6 decimal places. Source:CMU
13.2 The Binary Number System
Lets talk about precision.

Source:CMU
1.2 𝑒𝑥𝑎𝐹𝐿𝑂𝑃 = 1 𝑞𝑢𝑖𝑛𝑡𝑖𝑙𝑙𝑖𝑜𝑛 1018 𝐹𝐿𝑂𝑃𝑆
1,194 𝑝𝑒𝑡𝑎𝐹𝐿𝑂𝑃𝑆

Source: livescience.com
11.2 The Binary Number System
Complements and Negative numbers.
• To simplify the operation of subtraction in digital systems,
complements are used almost exclusively.
• X - Y → X + (-Y)
• This procedure makes things much simpler; the computer
hardware only requires “adding” circuitry.
• Two types of complements.
• Ones complement.
• Twos complement.
11.2 The Binary Number System
Ones complement.
• n-bit binary number by subtracting the number itself from (2n-1)
• For example.

a = 0101
Ones complement of a = (24-1) – a
= (10000 – 1) – (0101)
= (01111) – (0101)
= 1010

b = 101101
Ones complement of b = (26-1) – b
= (0111111) – (101101)
= 010010

• Hint: Flip all bits.


11.2 The Binary Number System
Twos complement.
• n-bit binary number by subtracting the number itself from 2n.
• For example.

a = 0101
Twos complement of a = (24) – a
= (1000) – (0101)
= 1011

b = 101101
Twos complement of b = (26) – b
= (1000000) – (101101)
= 010011

• Hint: Flip all bits and add 1.


• Most computers uses twos complements.
11.2 The Binary Number System
Binary convention to represent negative numbers?
• Sign-magnitude convention.
• Uses a sign bit at the beginning of the number.
(value 1 indicates negative, value 0 indicates positive).

• Ones complement notation.


• Sign bit is used.
• If number is positive, magnitude represented by true magnitude.
• If negative, magnitude represented by ones complement.

For example: (with 8 bit number).

+ 91 = 0 1011011
- 91 = 1 0100100
11.2 The Binary Number System
Binary convention to represent negative numbers?
• Sign-magnitude convention.
• Uses a sign bit at the beginning of the number.
(value 1 indicates negative, value 0 indicates positive).

• Twos complement notation.


• Sign bit is used.
• If number is positive, magnitude represented by true magnitude.
• If negative, magnitude represented by Twos complement.

For example: (with 8 bit number).

+ 91 = 0 1011011
- 91 = 1 0100101
11.2 The Binary Number System
Ones and Twos complement notation difference?

• Ones complement has two representation of 0 (Zero).


• Positive Zero (00000000), and negative zero (11111111).

• Twos complement only has one representation of 0 (0000000).


• Adding 1 to 11111111 (-12) = 00000000 (+010)

• The advantage of twos complement is that the algebraic sum of twos


complements binary number is simply the sum of the numbers
including the sign bit.

• Most computers uses twos complements.


11.2 The Binary Number System
Ex (twos complements)

2210 = 0 0010110

-2210= 1 1101010

0 0010110
+ 1 1101010
0 0000000
11.2 The Binary Number System
Hexadecimal System.
• Representing number as base-2 and base-10 is simply due to
convenience, which one is easier.
• Another frequently used system is base 16, Hexadecimal system.
• In Hex notation, binary numbers are grouped in 4 bits.
• Density?

1010 01112 = A716


0010 10012 = 2916
11.2 The Binary Number System
ASCII (American Standard Code for Information Interchange)
• Character encoding standard for electronic communication.
• Represented by 1 byte, 8 bit, 2 hex values.
• In programming languages, variable char

Source:Wikipedia
11.2 The Binary Number System
Well represented in the move The Martian.
• 26 alphabet letters. (13.8°).
• Binary, poor information density.

Source:20th century Fox


11.2 The Binary Number System
• There are two common binary codes.
• Binary-coded decimal (BCD) and Gray Code.
11.2 The Binary Number System
• Binary-coded decimal (BCD) and Gray Code.
• Position encoders on actuators or sensors.

Source:Wikipedia
11.2 The Binary Number System
• Absolute or Relative.

Source:Wikipedia, electronics exchange


11.2 The Binary Number System
• Detection Method.
• Optical vs. Electrical.
• Noncontact.

Source:Robotics Business Review


11.2 The Binary Number System
• Absolute or Relative.

Source:Wikipedia
11.3 Boolean Algebra and Logic Gates.
• Mathematics associated with binary number system is called Boolean.
• In honor of English mathematician George Boole.
• In 1854 published an article “An investigation of the Laws of
Thought, on Which Are Founded the Mathematical Theories of
Logic and Probabilities.:
• Developed logical algebra.
• The variables in a Boolean or logic expression can take only one
of two values represented in numbers 0 and 1.

Source:Wikipedia
11.3 Boolean Algebra and Logic Gates.
• The variables are referred also as True (1) and False (0). Voltages?
➢ This is normally called Positive logic.
• Negative logic convention (roles of logic 1 and 0 are reversed).
➢ False (1) & True (0)

• Analysis of logic functions performed with truth tables.

• Definition: a Truth table is a listing of all possible values that each of


the Boolean variables can take and the corresponding value of the
desired function (outcome).
X Y Z Function
11.3 Boolean Algebra and Logic Gates.

Source:exclusivearchitecture.com
11.3 Boolean Algebra and Logic Gates.

Source:exclusivearchitecture.com
11.3 Boolean Algebra and Logic Gates.

Source:Apple
11.3 Boolean Algebra and Logic Gates.

Source:ComputerWiki
11.3 Boolean Algebra and Logic Gates.
11.3 Boolean Algebra and Logic Gates.
11.3 Boolean Algebra and Logic Gates.
• Logic Gates are physical devices that implement logic functions.
• At the basis of Boolean algebra,
• Logical multiplication (AND operation).
• If both X and Y are true, then Z is true.
• Logical addition (OR operation).
• If either X or Y is true, then Z is true.

• The number of input can be > 2. Logic remains the same.


• Number of possible combination: 2n.
11.3 Boolean Algebra and Logic Gates.
• Any combination of logic is possible.
• Can be expressed in words.
• “The output Z shall be logic 1 only when the
condition (X = 1 AND Y = 1) OR (W = 1) and shall be logic 0
otherwise”.
11.3 Boolean Algebra and Logic Gates.
• NOT gate is an inverter.
• It can be constructed using BJT or MOSFET.
• Only has one input.
• NOT (X) is expressed as X’ or X
11.3 Boolean Algebra and Logic Gates.
• “The output Z shall be logic 1 only when the condition
(X = 0 AND Y = 1) OR (W = 1) and shall be logic 0 otherwise”.

• (X = 1 AND Y = 1) OR (W = 1)
11.3 Boolean Algebra and Logic Gates.
• Completely different logic.

You might also like