You are on page 1of 45

This Week’s Mantra

Be in the moment…

ECE 10: DIGITAL ELECTRONICS 1: LOGIC CIRCUITS & SWITCHING THEORY 1


INTRODUCTION TO LOGIC CIRCUITS
AND SWITCHING THEORY and
THE NUMBER SYSTEM
E N G R . MI A C. AWAYA N
E CE D EPA RT MEN T

ECE 10: DIGITAL ELECTRONICS 1: LOGIC CIRCUITS & SWITCHING THEORY 2


What is logic circuits?

ECE 10: DIGITAL ELECTRONICS 1: LOGIC CIRCUITS & SWITCHING THEORY 3


LOGIC CIRCUITS
Digital circuits are essentially circuits that operate on the
digital concept of 0s and 1s. Which means they switch on
or off. So we can say that they have a unique job of
switching on the application of a certain logic. And what
do we mean by logic? Essentially a specific arrangement
of binary codes. Consequently, these digital circuits are
also known as switching circuits.

ECE 10: DIGITAL ELECTRONICS 1: LOGIC CIRCUITS & SWITCHING THEORY 4


What does it mean by switching
theory?

ECE 10: DIGITAL ELECTRONICS 1: LOGIC CIRCUITS & SWITCHING THEORY 5


SWITCHING THEORY
It allows us to understand the operation and relationship
between Boolean Algebra and two-level logic functions
with regards to Digital Logic Gates. Switching theory can
be used to further develop the theoretical knowledge and
concepts of digital circuits when viewed as an
interconnection of input elements producing an output
state or condition.

ECE 10: DIGITAL ELECTRONICS 1: LOGIC CIRCUITS & SWITCHING THEORY 6


Switching Circuits
AND OR

ECE 10: DIGITAL ELECTRONICS 1: LOGIC CIRCUITS & SWITCHING THEORY 7


Where can you find the application
of logic circuits?

ECE 10: DIGITAL ELECTRONICS 1: LOGIC CIRCUITS & SWITCHING THEORY 8


Real life Application

Digital computers Examples:


◦ General purposes Buzzer
◦ Many scientific, industrial and commercial applications
Calculator
Digital systems Computer
◦ Telephone switching exchanges
Phones
◦ Digital camera
◦ Electronic calculators, PDA's Home Automation
◦ Digital TV Counters

Discrete information-processing systems Digital Clocks


◦ Manipulate discrete elements of information Every equipment/machines with digital system.
◦ For example, {1, 2, 3, …} and {A, B, C, …}… “Everywhere”

ECE 10: DIGITAL ELECTRONICS 1: LOGIC CIRCUITS & SWITCHING THEORY 9


Analog System vs. Digital
System

ECE 10: DIGITAL ELECTRONICS 1: LOGIC CIRCUITS & SWITCHING THEORY 10


How do we define analog system?

ECE 10: DIGITAL ELECTRONICS 1: LOGIC CIRCUITS & SWITCHING THEORY 11


Basic Principle of a CD Player
Basic Principle of a CD Player
Analog Systems
 An Analog system consists of devices that manipulate physical quantities
that are represented in analog form. Common analog systems are
amplifiers, magnetic recording and playback and even a simple dimmer
switch.

 Analog representation of a quantity is a value of voltages, currents or


meter movements that are proportional to a value of that quantity. An
example is the common mercury thermometer, where the level of
mercury varies with the temperature. Analog quantities have the
characteristic that can vary in a continuous range of values over a
continuous interval of time.

ECE 10: DIGITAL ELECTRONICS 1: LOGIC CIRCUITS & SWITCHING THEORY 14


Digital Systems
It is a combination of devices designed to manipulate logical
information or physical quantities represented in digital form. These
devices are often electronic but they can also be magnetic, mechanical,
pneumatic or hydraulic. Examples are calculators and computers.
Digital representation of a quantity is not by proportion to a quantity
but by use of a symbol, or a much common symbol - a digit. A prominent
example is a digital clock, as we know, time varies continuously, but for a
digital clock, the display does not change continuously, rather it changes
per unit step say once per second or once per minute. To make it clear,
digital representation changes in discrete steps or a step by step process.

ECE 10: DIGITAL ELECTRONICS 1: LOGIC CIRCUITS & SWITCHING THEORY 15


Analog vs. Digital Signal
Analog system
◦ The physical quantities or signals may vary continuously over a specified range.

Digital system
◦ The physical quantities or signals can assume only discrete values.
◦ Greater accuracy
X(t) X(t)

t t
ECE 10: DIGITAL ELECTRONICS 1: LOGIC CIRCUITS & SWITCHING THEORY
Analog signal Digital signal 16
Advantages of Digital system over Analog System

ECE 10: DIGITAL ELECTRONICS 1: LOGIC CIRCUITS & SWITCHING THEORY 17


1.Ease of programmability
2. Reduction in cost of hardware
3.High speed
4.High Reliability
5.Design is easy
6.Result can be reproduced easily

ECE 10: DIGITAL ELECTRONICS 1: LOGIC CIRCUITS & SWITCHING THEORY 18


Disadvantages
1.Use more energy than analog circuits to accomplish the
same tasks, thus producing more heat as well.
2.Digital circuits are often fragile, in that if a single piece
of digital data is lost or misinterpreted the meaning of
large blocks of related data can completely change.
3.Digital computer manipulates discrete elements of
information by means of a binary code.
4.Quantization error during analog signal sampling .

ECE 10: DIGITAL ELECTRONICS 1: LOGIC CIRCUITS & SWITCHING THEORY 19


Number System

ECE 10: DIGITAL ELECTRONICS 1: LOGIC CIRCUITS & SWITCHING THEORY 20


Number system is a basis for counting varies items. Modern
computers communicate and operate with binary numbers. Data
is represented as 1’s and 0’s. These 1’s and 0’s might be stored
magnetically in a disk, or as state in a transistor, or vacuum tube.
A familiarity with the binary number system is necessary for two
primary reasons. First, binary numbers will appear frequently as
a notational device. Second, digital computers generally work
with binary numbers in some form, and many of the best
examples of both combinational and sequential circuits are drawn
from subsystems within computers.

ECE 10: DIGITAL ELECTRONICS 1: LOGIC CIRCUITS & SWITCHING THEORY 21


Number Systems
1.Decimal
2.Binary
3.Octal
4.Hexadecimal

ECE 10: DIGITAL ELECTRONICS 1: LOGIC CIRCUITS & SWITCHING THEORY 22


Decimal Number system
The decimal system has ten symbols:
0,1,2,3,4,5,6,7,8,9. In other words, it has a base of 10.
We use this system for all our arithmetic
operations in our daily life. Since it is easily readable
by humans, it is widely used, as compared to the
other systems.

ECE 10: DIGITAL ELECTRONICS 1: LOGIC CIRCUITS & SWITCHING THEORY 23


Decimal Number System
Base (also called radix) = 10
◦ 10 digits { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }
Digit Position
◦ Integer & fraction
Digit Weight
◦ Weight = (Base) Position
Magnitude
◦ Sum of “Digit x Weight”
Formal Notation

ECE 10: DIGITAL ELECTRONICS 1: LOGIC CIRCUITS & SWITCHING THEORY 24


Binary Digital Signal
An information variable represented by physical quantity.
For digital systems, the variable takes on discrete values.
◦ Two level, or binary values are the most prevalent values.

Binary values are represented abstractly by:


◦ Digits 0 and 1 V(t)
◦ Words (symbols) False (F) and True (T)
◦ Words (symbols) Low (L) and High (H)
◦ Logic 1
And words On and Off

Binary values are represented by values or ranges of undefine


values of
physical quantities.
Logic 0
t
Binary digital signal
ECE 10: DIGITAL ELECTRONICS 1: LOGIC CIRCUITS & SWITCHING THEORY 25
Binary Number System
Base = 2
◦ 2 digits { 0, 1 }, called binary digits or “bits”

Weights
◦ Weight = (Base) Position

Magnitude
◦ Sum of “Bit x Weight”

Formal Notation
Groups of bits 4 bits = Nibble
8 bits = Byte
ECE 10: DIGITAL ELECTRONICS 1: LOGIC CIRCUITS & SWITCHING THEORY 26
Octal Number System
Base = 8
◦ 8 digits { 0, 1, 2, 3, 4, 5, 6, 7 }
Weights
◦ Weight = (Base) Position
Magnitude
◦ Sum of “Digit x Weight”
Formal Notation
ECE 10: DIGITAL ELECTRONICS 1: LOGIC CIRCUITS & SWITCHING THEORY 27
Hexadecimal Number System
Base = 16
◦ 16 digits { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F }
Weights
◦ Weight = (Base) Position
Magnitude
◦ Sum of “Digit x Weight”
Formal Notation

ECE 10: DIGITAL ELECTRONICS 1: LOGIC CIRCUITS & SWITCHING THEORY 28


Decimal, Binary, Octal and Hexadecimal
Decimal Binary Octal Hex
00 0000 00 0
01 0001 01 1
02 0010 02 2
03 0011 03 3
04 0100 04 4
05 0101 05 5
06 0110 06 6
07 0111 07 7
08 1000 10 8
09 1001 11 9
10 1010 12 A
11 1011 13 B
12 1100 14 C
13 1101 15 D
14 1110 16 E
15 1111 17 F
ECE 10: DIGITAL ELECTRONICS 1: LOGIC CIRCUITS & SWITCHING THEORY 29
Binary Codes

ECE 10: DIGITAL ELECTRONICS 1: LOGIC CIRCUITS & SWITCHING THEORY 30


Binary Codes
BCD Code
◦ A number with k decimal digits will require
4k bits in BCD.
◦ Decimal 396 is represented in BCD with
12bits as 0011 1001 0110, with each group
of 4 bits representing one decimal digit.
◦ A decimal number in BCD is the same as
its equivalent binary number only when
the number is between 0 and 9.
◦ The binary combinations 1010 through
1111 are not used and have no meaning in
BCD.
ECE 10: DIGITAL ELECTRONICS 1: LOGIC CIRCUITS & SWITCHING THEORY 31
Binary Codes
Other Decimal Codes

ECE 10: DIGITAL ELECTRONICS 1: LOGIC CIRCUITS & SWITCHING THEORY 32


Binary Codes)
Gray Code
◦ The advantage is that only bit in the code
group changes in going from one number
to the next.
◦ Error detection.
◦ Representation of analog data.
◦ Low power design.
000 001

010 011
100 101

110 111

1-1 and onto!!


ECE 10: DIGITAL ELECTRONICS 1: LOGIC CIRCUITS & SWITCHING THEORY 33
Binary Codes

American Standard Code for


Information Interchange
(ASCII) Character Code

ECE 10: DIGITAL ELECTRONICS 1: LOGIC CIRCUITS & SWITCHING THEORY 34


Binary Codes
ASCII Character Code

ECE 10: DIGITAL ELECTRONICS 1: LOGIC CIRCUITS & SWITCHING THEORY 35


ASCII Character Codes
American Standard Code for Information Interchange (Refer to Table 1.7)
A popular code used to represent information sent as character-based data.
It uses 7-bits to represent:
◦ 94 Graphic printing characters.
◦ 34 Non-printing characters.

Some non-printing characters are used for text format (e.g. BS = Backspace,
CR = carriage return).
Other non-printing characters are used for record marking and flow control
(e.g. STX and ETX start and end text areas).

ECE 10: DIGITAL ELECTRONICS 1: LOGIC CIRCUITS & SWITCHING THEORY 36


ASCII Properties
ASCII has some interesting properties:
◦ Digits 0 to 9 span Hexadecimal values 3016 to 3916
◦ Upper case A-Z span 4116 to 5A16
◦ Lower case a-z span 6116 to 7A16
◦ Lower to upper case translation (and vice versa)
occurs by flipping bit 6.

ECE 10: DIGITAL ELECTRONICS 1: LOGIC CIRCUITS & SWITCHING THEORY 37


Binary Codes
Error-Detecting Code
◦ To detect errors in data communication and processing, an eighth bit is
sometimes added to the ASCII character to indicate its parity.
◦ A parity bit is an extra bit included with a message to make the total number
of 1's either even or odd.
Example:
◦ Consider the following two characters and their even and odd parity:

ECE 10: DIGITAL ELECTRONICS 1: LOGIC CIRCUITS & SWITCHING THEORY 38


Binary Codes
Error-Detecting Code
◦ Redundancy (e.g. extra information), in the form of extra bits, can be
incorporated into binary code words to detect and correct errors.
◦ A simple form of redundancy is parity, an extra bit appended onto the code
word to make the number of 1’s odd or even. Parity can detect all single-bit
errors and some multiple-bit errors.
◦ A code word has even parity if the number of 1’s in the code word is even.
◦ A code word has odd parity if the number of 1’s in the code word is odd.
◦ Example: Message A: 100010011 (even parity)
Message B: 10001001 0 (odd parity)

ECE 10: DIGITAL ELECTRONICS 1: LOGIC CIRCUITS & SWITCHING THEORY 39


Binary Storage and Registers
Registers
◦ A binary cell is a device that possesses two stable states and is capable of storing one of the two states.
◦ A register is a group of binary cells. A register with n cells can store any discrete quantity of information that contains n bits.

n cells 2n possible states


A binary cell
◦ Two stable state
◦ Store one bit of information
◦ Examples: flip-flop circuits, ferrite cores, capacitor

A register
◦ A group of binary cells
◦ AX in x86 CPU

Register Transfer
◦ A transfer of the information stored in one register to another.
◦ One of the major operations in digital system.
◦ An example in next slides.

ECE 10: DIGITAL ELECTRONICS 1: LOGIC CIRCUITS & SWITCHING THEORY 40


A Digital Computer Example
Memory

Control
CPU unit Datapath

Inputs: Keyboard, Outputs: CRT,


mouse, modem, LCD, modem,
Input/Output
microphone speakers

Synchronous or
Asynchronous?
ECE 10: DIGITAL ELECTRONICS 1: LOGIC CIRCUITS & SWITCHING THEORY 41
Transfer of information

Figure 1.1
ECE 10:Transfer of information
DIGITAL ELECTRONICS among
1: LOGIC CIRCUITS & SWITCHING register
THEORY 42
Transfer of information

The other major component of a


digital system
◦ Circuit elements to manipulate
individual bits of information
◦ Load-store machine
LD R1;
LD R2;
ADD R3, R2, R1;
SD R3;

Figure 1.2 Example of binary information


ECE 10: DIGITAL ELECTRONICSprocessing
1: LOGIC CIRCUITS & SWITCHING THEORY 43
Activity
Answer the Performance Tasks on Module 1.
Due Date:

ECE 10: DIGITAL ELECTRONICS 1: LOGIC CIRCUITS & SWITCHING THEORY 44


End

ECE 10: DIGITAL ELECTRONICS 1: LOGIC CIRCUITS & SWITCHING THEORY 45

You might also like