You are on page 1of 23

ELEC1010 Tutorial 5

Analog Signals and Systems


Digital Signals and Systems
Binary Format
Binary Logic
Analogy Signals and Systems
 Analog Signals
 Continuous
 Not countable
 Have an infinite number of values
 e.g. audio signal, visual signal, distance, time
 Analog System
 Signal is manipulated as a continuously changing
quantity
 e.g. AM/FM radio, TV, Film camera
2

2
Digital Signals and Systems

 Discrete values at discrete time/space instance


 Have limited number of values
 Countable
 e.g. digital clock, MP3 music, 26 alphabets

3
Why Digitization
 Analog systems are bulky
 An analog signal has arbitrary values, not easy to modify, correct
or store Transmitted signal could be
Received
1.0 1.0
0.5 0.5
0.0 time 0.0 time
Or Or
1.0 1.0
0.5 0.5
time 0.0 time
0.0
 Digital signal has discrete-time values (e.g. 0 and 1)
 Received signal can be corrected by threshold detection
received signal
1.0
threshold 0.5
time
0.0 recovered digital signal
Recovered bits: 1 0 0 1 1 0 1 0 0
 The storage of digital signals requires limited memory.

4
Analog, Digital Signal – Example
Consider the time-domain analog signal plotted below, assume that
during the transmission of the signal the following additive noise is
introduced:
A/V Original signal A/V Additive noise

1 0.6

1 2 3 4 5 6 7 t/s
1 2 3 4 5 6 7 t/s -0.6

-1 -1.2
Figure 1 Figure 2

Plot the analog signal at the output. (Assume that the transmission
noise is additive) A/V
Answer: 0.4

-0.2 1 2 3 4 5 6 7 t/s
-0.4

-1.6
5
Example
Suppose the Signal in Figure 1 represents the transmitted signal for
a sequence of binary data, with 1 V representing a bit “1” and -1 V
representing a bit “0”.
A/V
What is the binary data represented Original signal
by the signal? 1

1001011 1 2 3 4 5 6 7 t/s

-1
Assume that threshold detection is used at Figure 1

the receiver, and that the threshold is set A/V


to be 0. What is the digital output of the Signal received
0.4
receiver?
-0.2 1 2 3 4 5 6 7 t/s

1000011 -0.4

error bit -1.6

6
Binary Format
Bit & Byte
 Bit – binary digit
 The most basic unit of information
 A unit of information measurement
 Value: 0 or 1
Refers to a digit in the binary numeral system (base 2)
 1 bit can represent 21 = 2 situations
2 bits can represent 22 = 4 situations
N bits can represent 2N situations

7
Binary Format
Bit & Byte

 Byte
 1 Byte = 8 bits
 1 byte can represent 28 = 256 situations
 1KB = 210 = 1024 Bytes (not 1000 Bytes)
1MB = 220 = 1,048,576 bytes (not 1,000,000 bytes)

A 64-bit (8-byte) microprocessor means the CPU can


process a 64-bit data (264 combinations) each time. 8

8
Base 10 & Base 2 System
Base 10 System—We are familiar with
Decimal system
10 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

6 9 2

100 10 1
102 101 100 powers of 10

692=6×(100)+9×(10)+2×(1)
9
= 6×(102)+9×(101)+2×(100)
9
Base 2 System-binary system

2 digits: 0, 1

1 0 1 1 0 0 0 1

27 26 25 24 23 22 21 20
powers of 2
128 64 32 16 8 4 2 1

1×27+0×26+1×25+1×24+0×23+0×22+0×21+1×20=177

10110001 is 177 in base 10 system 10

10
How to convert from base 10 to base 2

 Use Look-up Table for Power of 2


 Short Division by 2

11

11
How to convert from base 10 to base 2
Look-up table 20 = 1
21 = 2
 Use look-up table for power of 2 22 = 4
 Find the closest power-of-2 that has value equal 23 = 8
to or less than the base-10 number for conversion. 24 = 16
 Find the difference. For the remainder, find the 25 = 32
closest power-of-2 that has value equal to or less 26 = 64
than the remainder. 27 = 128
 Repeat the above 28 = 256
e.g. 540-512=28 28-16=12 29 = 512
2 10 = 1024
540=512+16+8+4
=1×29+0×28+0×27+0×26+0×25+1×24+1×23+1×22 12
1 0
+0×2 +0×2 =1000011100 (10-bit base 2)
12
How to convert from base 10 to base 2
 Short Division by 2
Keep dividing by 2 and note the remainder in each division

2 540 0
2 270 0
2 135 1
2 67 1 540=1000011100 (10-bit base 2)
2 33 1
2 16 0
2 8 0
2 4 0
2 2 0
1 13

13
Binary Format – Exercise 1
How many distinct values can we represent with 4 bits?

A. 4
B. 8
C. 16
D. 32
E. 256

Answer: C

14
Binary Format – Exercise 2
What is the 1-byte binary representation of decimal number 10?

A. 00001010
B. 1010
C. 11111010
D. 0101
E. 11100

Answer: A

15
Binary Logic
Logic Operation
 NOT
 One input (A) Truth Table
 One output (B)
A B
 When input A is 1, the output B is 0 1 0
 When input A is 0, the output B is 1 0 1
Symbol
__
A B Mathematical formula: BA

: A bar
A NOT
Complement of A
16
Binary Logic
Logic Operation
 AND
 Two inputs (A, B)
 One output (C)
 When both the inputs A and B are 1 the output C is 1,
otherwise, the output C is 0
Truth Table
Symbol
A A B C
C
B 0 0 0
0 1 0
Mathematical formula:
1 0 0
C  A B 1 1 1
17
Binary Logic
Logic Operation
 OR
 Two inputs (A, B)
 One output (C)
 When both the inputs are 0, the output is 0; otherwise the
output is 1
Truth Table
Symbol
A A B C
C
B 0 0 0
0 1 1
Mathematical formula: 1 0 1
C  A B 1 1 1
18
Logic Operation–Exercise
Alice, Bob and Claire formed a committee to vote if David could be
the president of the “Student Service Society”.
If all of them (Alice, Bob and Claire) agree on David being the
president, then David will become the president of the “Student
Service Society”. If Claire and anyone else (Alice or Bob) agree on
David being the president, then David will become the president.
Otherwise, David will not be the president.
1) Write down the truth table which includes agreement and
disagreement combinations from Alice, Bob and Claire and whether
David could be the president or not. (Use “1” and “0” to represent
what an individual person agrees on and disagrees on David being the
president respectively. Use “1” and “0” to represent that David will be
and will not be the president respectively)
2) What is the logic formula representing the voting? (A, B, C and D
represent voting state of Alice, Bob, Claire and David respectively)

19
Logic Operation–Answer
1) Alice Bob Claire David
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 0
1 1 1 1
2) When all Alice, Bob and Claire agree on David being the president
then David will be, it is an AND operation of Alice, Bob and Claire
represented by D=ABC
When Claire agree and Alice agree on David being the president then
David will be, can be represented by D  ABC  ABC
When Claire agree and Bob agree on David being the president then
David will be, can be represented by D  ABC  ABC
D  ABC  ABC  ABC represents the voting.
20
Logic Operation–Example
7 – Segment LED Digit Display
 Found in digital clock, calculator, scoreboard, etc
 Consists of seven LED (Light Emitting Diode) a
f b
segment g
 The segment is identified by a, b, c, d, e, f, g e c
d
 Four inputs
 Seven outputs

21
7 – Segment LED Digit Display
0: a, b, c, d, e and f are on
a
f b 1: b and c are on
g 2: a, b, g, e and d are on
e c 3: a, b, c, d and g are on
d 4: f and g and b and c are on
…………………………….
How many input bits are needed?
Answer: There are 10 digits to be displayed (0-9), namely 10 different
combinations of input bits are need.
23 = 8, provides 8 different combinations, which is not enough to
represent 10 digits.
24 = 16, provides 16 different combinations, can represent 10 digits.
Therefore, 4 input bits are needed.
How may output bits are there?
Answer: There are 7 segments LED, therefore there are 7 output bits.
22
…Truth Table (4 input bits, 7 output bits)
a
f b

e c
d

23

You might also like