Sei sulla pagina 1di 44

ELEC1010 Electronic & Information Technology

Chapter 2 -- Foundation of Digital Systems:

Binary Number and Digital Logic

P.1
ELEC1010 Electronic & Information Technology

Lecture 8 – Benefits of Digitization

P.2
Analog Signals
• An analog signal represents a physical phenomenon that varies
continuously with time and in amplitude. Examples: the sound
we hear, the visual signal we see, the current generated by the
mouthpiece of a conventional telephone, etc.
• A continuous quantity is not countable – for any two possible
distinct values of the quantity, there are other possible values in
between. A continuous quantity can take on an uncountable
infinite number of values.

In the classical world model, many physical quantities in


nature are continuous and varies continuously with time:
distance, mass, velocity, force, etc.

P.3
Analog Systems
• A system is analog when the signal is manipulated (e.g.
filtered, modulated, amplified, transmitted, received) as a
continuously changing quantity. Examples:

- Human body such as auditory and visual systems

- The telephone invented by Bell in 1876

- AM/FM modulation for signal transmission over radio

- Analog TV

- Film camera

P.4
Alexander Graham Bell and his Telephone
• In 1876, Bell invented the telephone. At the mouth piece, a person’s
speech moves a diaphragm which compresses the carbon grains and
changes their electrical resistance, causing changes in the electrical
current flowing through the telephone circuit. At the receiver, the current
drives a magnet which moves a diaphragm to re-create the speech signal.
current

time

P.5
Degradation of Analog Signal
As an electrical telephone signal is transmitted over long distance, it
may suffer degradations in many ways:
•Attenuation – the amplitude of the signal is proportionally reduced
•Distortion – the signal is changed in a non-linear way, caused by
the transmission medium or by the amplifiers
•Noise – some random garbage signal is added because of
electrical interference or other noise sources

Electrical
Blurring because of
Current Random Noise

Attenuated and distorted

time
10 ms 20 ms
In the past, the end result was that long-distance phone calls
sounded very poorly! P.6
Digital Signals and Systems
• A digital signal is a quantity that is measured in discrete values
at discrete time/space instances – the gender of one or a group
of students in this class, a .bmp computer file, the 64 kilo bits
per second (kbps) telephone signal in the modern telephone
network, etc.
• A true analog signal can have an infinite number of values. Any
finite system must inherently be digital/discrete.
While human touch and feel analog signals, we process
information in digital terms – we make yes/no decision; we
can deal with physical quantities only with finite accuracies.

• Consider your age, or your height. Are they continuous or


discrete quantities? They are supposedly continuous but any
answer that you can give me is discrete!

P.7
Digital Systems for Information Processing
• George Boole (1815 – 1864), an English mathematician,
invented Boolean Algebra, which for many years did not
seem to have any practical use.

• Claude Shannon was introduced to Boolean’s work in a


philosophy class at U. of Michigan and latter completed
a master thesis at MIT in 1937 in which he demonstrated
how Boolean Algebra could be applied to simplify the
telephony switching systems. He also turned the
problem around and showed how switches could be
used to solve any logic problems.

• In 1936, Alan Turing proposed what is now known as the


Turing Machine, which demonstrated how complex
problems can be solved with a simple conceptual
machine with “states” and a supply of “instructions.”

P.8
The Benefits of Digitization
• Analog signal cannot be easily duplicated, stored or modified.
• Analog signal, once degraded, cannot be easily corrected.
• Analog systems are bulky and not easily modifiable to solve new
or different tasks.

• Digital information takes on only discrete values so that it can be


exactly reproduced, stored and moved from place to place, from
device to device.
• Once information is in the digital form, it can be processed by the
modern computer which can be programmed and reprogrammed
to perform different tasks. For example, we can use digital-
processing to reduce unwanted sounds, combining sounds and
images from different sources, or adding special effects, etc.

P.9
Example: Shortcomings of Analog Communications
• In analog communications (e.g. old telephone network, AM/FM
radio, analog TV), information is a real-value signal continuously
varying in time.
• Distortion in the course of transmission is very expensive to avoid
and undo, and cannot be completely eliminated.
• Noise, additive noise, by definition cannot be removed because it
is random and unknown!

Additive noise will be added to the original transmitted signal.

received analog signal looks “blurry” with noise


1.0
0.5 time
0.0
P.10
Analog Communications – Signal to Noise Ratio
• The only way to minimize noise error in analog communications
is to use the “brute-force” way - send a larger signal (increase the
transmission power!), such that the noise added in the course of
transmission is small compared to the signal power.

• Engineers use the signal-to-noise ratio (SNR) as a measure of


the quality of the signal transmitted.
Higher SNR:
Larger signal amplitude for the
4 same amplitude of noise

2
time

P.11
Advantages of Digital Communications
• In digital communications, information is a binary (0 or 1)
signal that varies discretely in time.

• Noise added in the course of transmission can be corrected


by a process known as “threshold detection,” and by coding
schemes to be described in Chapter 4!

Threshold Detection: if the binary symbols are 1’s and 0’s


that correspond to signal values 1 and 0, respectively, then
we can say:

(1) A received signal value larger than 0.5 can be considered


as a “1”.

(2) A received signal value smaller than 0.5 can be


considered as a “0”. P.12
Threshold Detection with Averaging
• To improve accuracy, a receiver can take the average value of the
signal over one bit time. If the average value is larger than 0.5, we
assume the transmitted bit is a 1. Otherwise we assume 0.

Transmitted bits:
1 0 0 1 1 0 1 0 0
received signal recovered digital signal
1.0

0.5
time

0.0 Some part of the received bit > 0.5


and some part < 0.5
Received bits: By averaging, we assume correctly that the bit is 0

1 0 0 1 1 0 1 0 0
P.13
So how do we “Go Digital”
• That is to ask how to take information such as sounds,
pictures, and text and turn them into numbers?

• The process of representing various types of information


in a form that can be stored and processed by a digital
device (such as a computer) is called digitization.

Digitization produces a “digital signal” from an analog


(continuous) signal.
Also known as “analog-to-digital conversion.”
Digitization will be the subject of the next Chapter. In
this Chapter, we will discuss the principles of digital
logic.
P.14
Example - Digital Telephony
• Since the 1970s, the core of the telephone network has been
converted into a digital network. Each voice signal is converted
into a digital signal of 64 kilo bits per second (kbps) – each
analog voice signal is sampled 8,000 times per second, and 8
bits are used to represent the amplitude of each sample,
meaning that each sample can be represented by only one of
256 values (28).
current
Analog voice signal

time
0.125 ms
Transmitted Bits
8 bits 64 kbps digital voice signal

time
0.125 ms
P.15
Example: Digital TV - no snowy pictures
Hong Kong started digital TV broadcast in 2007. In USA,
all analog TV broadcast ceased in February 2009!
Traditional Analog TV system

New Digital TV system

Analog – weak signals with added Digital – clear pictures can be


noise cause snowy pictures. received at weak signal levels.

P.16
Example: Digital TV - no ghosting
Besides attenuation, distortion, and noise, wireless transmission of
signals suffers from another degradation known as multi-path
where the receiver receives multiple copies of the original signal
with different delays as the transmitted signal reflects off different
obstacles.

P.17
Demo – Noise and Distortion to Analog Signal
• Below are four versions of a
piece of music Time Domain Signal (enlarge a portion of the original signal)
Time Domain Signal (enlarge a portion of distorted signal)
1.5
0.4

0.3

0.2
1
0.1

-0.1
0.5

-0.2

-0.3

-0.4 0
0 0.001 0.002 0.003 0.004 0.005 0.006 0.007 0.008 0.009 0.01 0 0.001 0.002 0.003 0.004 0.005 0.006 0.007 0.008 0.009 0.01
time(s) time(s)

 Original  Original with distortion


Time Domain Signal (enlarge a portion of degraded signal)
Time Domain Signal (enlarge a portion of signal with noise) 2
0.5

0.4
1.5
0.3

0.2
1
0.1

0 0.5

-0.1

-0.2 0

-0.3

-0.4 -0.5
0 0.001 0.002 0.003 0.004 0.005 0.006 0.007 0.008 0.009 0.01
time(s)
-0.5
0 0.001 0.002 0.003 0.004 0.005 0.006 0.007 0.008 0.009 0.01

 Original with noise and


time(s)

 Original with noise


distortion
P.18
Summary - Lecture 8
• An analog signal varies continuously with time and takes on a
continuous range of values. A digital signal varies only in
discrete time steps and takes on a finite set of values.

• Signals may suffer from attenuation, distortion, noise, and multi-


path in the course of transmission.

• Degradations to analog signals are difficult to undo while digital


signals can be “exactly” reproduced with the use of techniques
such as threshold detection and coding.

• Analog systems are bulky and are typically designed for specific
tasks only. Digital systems are highly compact with today’s IC’s
and can be easily programmed to perform different tasks.
P.19
ELEC1010 Electronic & Information Technology

Lecture 9 – Logic with Bits and Bytes

P.20
What is that “b” symbol?
• In the digital world, a bit is the most basic unit of
information.

• “Bit” is short for binary digit.


It refers to a digit in the binary numeral system (base 2).

• A bit of storage is like a light switch.


It can be either on (1) or off (0).
( A bit can represent 2 situations.)

OFF “0” ON “1”


P.21
Two bits can represent 4 situations
• Two bits can represent 2 4
2
situations.

00 01

11
10

P.22
What is that “B” symbol then?
• A byte (B) = 8 bits

It can represent 2  256


8
situations.

0 0 0 0 0 0 0 0

1 1 1 1 1 1 1 1
P.23
A simple look-up table for power of 2

20 = 1
21 = 2
22 = 4
23 = 8
24 = 16
25 = 32
26 = 64
27 = 128
28 = 256
29 = 512
210 = 1024
P.24
Math we are familiar with: Base 10 System
• Base-10 system uses powers of 10 and the digits are 0, 1, 2, …, 9.
• It is also known as the decimal system
• The number 238 in the decimal system means:

2 x 102, or two 100s


3 x 101, or three 10s
8 x 100, or eight 1s

P.25
Math digital devices are familiar with: Base 2 System
(Binary Numbers)

• Digital devices operate on binary logic (true/false) and it is


much easier to understand their operations using the base-2
system of numbers (powers of 2)

e.g. What is the binary number 1101 (a 4-bit number) in base 10?

1 x 23 = 8
1 x 22 = 4
0 x 21 = 0
1 x 20 = 1
P.26
Another example on base 2: an 8-bit number

e.g. What is the above binary number (a 8-bit number) in base 10?

1 x 27 = 128 1(128) + 1(64) + 1(32) + 0(16)


1 x 26 = 64 + 1(8) + 1(4) + 1(2) + 0(1) = 238
1 x 25 = 32
0 x 24 = 0
1 x 23 = 8
1 x 22 = 4
1 x 21 = 2
0 x 20 = 0
P.27
So how to convert from base10 to base 2?
• Find the closest power-of-2 that Example
has value equal to or less than 361
the base-10 number for
- 256 1x28
conversion.
105
- 64 1x26
• Find the difference. For the
remainder, find the closest
41
power-of-2 that has value equal - 32 1x25
to or less than the remainder. 9
- 8 1x23
Repeat the above 1 1x20

Hence, 361 = 1 0 1 1 0 1 0 0 1

P.28
Examples: Conversion from base10 to base 2
e.g. How to convert 14 in base-10 to a binary number?

14 = 8 + 6 = 8 + 4 + 2

= (1 x 23) + (1 x 22) + (1 x 21) + (0 x 20)

= 1110 (4-bit base 2)

e.g. How to convert 361 in base-10 to a binary number?

361 = 256 + 105 = 256 + 64 + 41

= 256 + 64 + 32 + 8 + 1

= (1 x 28) + (0 x 27) + (1 x 26) + (1 x 25) + (0 x 24) + (1 x 23)


+ (0 x 22) + (0 x 21) + (1 x 20)

= 101101001 (9-bit base 2)


P.29
Another Way for Conversion – Short Division by 2

• Keep dividing by 2 and note the


remainder in each division: 2)361 1
2)180 0
• “361” is enough for dividing by 2 2)90 0
for eight times. Therefore the 2)45 1
resulting binary number should 2)22 0
have 9 bits
2)11 1
• The resulting binary number is:
2)5 1
2)2 0
361 = 1 0 1 1 0 1 0 0 1
1

P.30
Binary Logic
• Latest computer chips are composed of billions of transistors
(electronic switches at the tens of nanometers scale), and
each transistor can be used to represent a “0” or “1” (“off” or
“on”).

• The problem now turns to how those “0” and “1” work together
to make our computers so powerful!

• Whenever you run any computer program (e.g. a window OS,


a Word Processor, a computer game), your computer actually
needs to process a huge amount of mathematical problems.
– The CPU deals with this mathematical calculation by
Binary Logic

• In fact, all computations in this world can be done by


three basic logic operations: NOT, AND, OR. Each is
also called a logic gate in an electronic circuit.
P.31
Logic operation – NOT
• The simplest operation with one Input (A), one Output (B)
• When A = “1”, B = “0”
• When A = “0”, B = “1”
• A logic operation can be described in several ways:
1. Symbol 2. Mathematical formula:

Standard __
A B
BA Pronounced commonly
as “A bar”, “A not”, or
Abbreviated “not A”
A B

3.Truth Table
A B Truth Table
-- how a logic circuit's output
1 0 responds to various
0 1 combinations of the inputs

P.32
Logic operation – AND
• Two Inputs (A,B), One Output (C)

• When A and B = “1” , C = “1”


• Otherwise C =“0”
Symbol Mathematical formula:
A

B
C C  A B Pronounced
“C equals A and B”
Truth Table
A B C
0 0 0
0 1 0
1 0 0
1 1 1
P.33
Logic operation – OR
• Two Inputs (A,B), One Output (C)

• When A or B = “1” , C = “1”


• Otherwise C =“0”
Symbol Mathematical formula:
A
C C  A  B Pronounced
B “C equals A or B”
Truth Table
A B C
0 0 0
0 1 1
1 0 1
1 1 1
P.34
Building more Complex Logic Operation – Example 1
__
D  ( A  B)  C
Truth Table
__ __
A B ( A B) C C D  ( A  B)  C
0 0 0 0 1 1
0 0 0 1 0 0
0 1 0 0 1 1
0 1 0 1 0 0
1 0 0 0 1 1
1 0 0 1 0 0
1 1 1 0 1 1
1 1 1 1 0 1

P.35
Logic operation – Example 1
Symbol Diagram

A ( A B)
B

D
__
C
C

• Next, let’s see how we can do some useful logic such as a


digit display.

P.36
Example 2: 7-Segment LED Digit Display
• Found in your digital watch, clock, scoreboard, etc.
• Consists of seven LED (Light-Emitting Diode) segments
• We want to light up the display based on the input digit – 4-bit input (4
bits to specify the digit 0-9) and 7-bit output (on/off for each segment)

P.37
Truth Table
a
f b
g
e c
d

P.38
Logic Diagram

Approximately how
many gates are there?
Note the followings:

O is an abbreviated notation
for the inverter
Some gates have 3 – 4 inputs!
We can insist of using
gates with 2 inputs only but
the diagram will look more
complicated.
P.39
Power of Modern Digital Processing
• All digital operations can be expressed by truth tables
and implemented by logic gates. There are algorithms
to reduce the number of gates. Modern technologies
allow us to integrate hundreds of millions of gates on a
tiny device called an integrated circuit (IC)!

• The ICs are built into modules and modules are


connected together to form computers, mobile phones,
and many other electronic systems.

P.40
Integrated Circuit Example
• Intel i7 Processor: Broadwell
• Fabrication process: 14nm
CMOS process
• i7-6950X: 10 core, 3GHz,
140W, 3.2B transistors
• Die photo

P.41
Integrated Circuit Fabrication
• Foundry: fabricate IC on
silicon wafers
• Photolithography
technologies
– Diffraction
• Line width
– uP: 14nm
– iPhone: 16nm
– TSMC: 10nm, 2016Q3
5nm, 2019E
– Intel: 10nm, 2018E

P.42
A Note on Digital Notations
• In the computer industry, things go by the power of 2.
• 1 MB has 220 = 1,048,576 bytes (not 1,000,000 bytes).
• Similarly, 1 KB is actually 210 = 1024 bytes (not 1000 bytes).
• Sometimes, the following convention is followed: “K” in 1 KB is
in capital letter, while the “k” in 1 kbps is in small letter.

210 = 1024 =1K


216 = 65,536 = 64 K
220 = 1,048,576 =1M
230 = 1,073,741,824 =1G
232 = 4,294,967,296 =4G
So when you download a 1G file on P2P, you are
downloading 1,073,741,824 bytes!
P.43
Summary - Lecture 9
• While a decimal number represents a sum of powers of ten, a
binary number represents a sum of powers of two. We have
learned how to convert between the decimal system and the
binary system

• Introduced binary logic: NOT, AND, OR operations

• Introduced the concept of logic truth table, mathematical


formula, and symbol diagram

• 7-segment display example

P.44

Potrebbero piacerti anche