Docsity

ECE 110 Handout 13: Binary and Hexadecimal Number Systems, Adders, and 7-segment Displays , Study notes of Electrical and Electronics Engineering

Toggle sidebar
bg1
ECE 110 M.-C. Brunet
Adders, and 7-segment Display Handout 13
Digital Information
Binary Number System
In ECE 110 we will onl
y
consider positive numbers!
Decimal numbers (Q‘in base 10’)
Example 1:(527)10, (725)10
Binar
y
numbers (Q‘in base 2’)
Example 2:(101)2= ( ? )10
Example 3:(527)10 = ( ? )2Know the powers of 2!
M.-C. BRUNET ECE 110 UIUC 13.1
A binar
y
di
g
it is called a ‘bit’.
The binary coding of (527)10 has ______ bits.
Example 4:
STORAGE FOR NUMBERS:
A LIMITED NUMBER OF BITS
Example 5:6 bits storage
( )10
000000
( )10
( )10
001000
100001
( )10
Know
the powers of 2!!!!!
111111
Know
the
powers
of
2!!!!!
To store up to number (25)10 how many bits
are needed for the binary coding?
M.-C. BRUNET ECE 110 UIUC 13.2
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download ECE 110 Handout 13: Binary and Hexadecimal Number Systems, Adders, and 7-segment Displays and more Study notes Electrical and Electronics Engineering in PDF only on Docsity!

Digital Information

Binary Number SystemIn ECE 110 we will only consider positive numbers!Decimal numbers

(Q

‘in base 10’)

Example 1: (527)

10

Binary numbers

(Q

‘in base 2’)

Example 2: (101)

10

Example 3: (527)

2

Know the powers of 2!

M.-C. BRUNET

ECE 110

UIUC

A binary digit is called a ‘bit’.The binary coding of (527)

has ______ bits. 10

Example 4:

STORAGE FOR NUMBERS:

A LIMITED NUMBER OF BITS

Example 5

: 6 bits storage

(^

)^10

(^

)^10

(^

)^10

(^

)^10

1 Know the powers of 2!!!!!

Know the powers of 2!!!!!To store up to number (25)

10

how many bits

are needed for the binary coding?

M.-C. BRUNET

ECE 110

UIUC

Hexadecimal Number SystemMore convenient than binary tocode large amount of bits

Decimal

Binary

Hexa

Decimal

Binary

Hexa

0

8

code large amount of bits16 different (hexa) digits 0 1 2 3

8 9 1011

4 5 6 7

12131415

7

15

Example 6:

(2C )

16

10

  1. From binary:

M.-C. BRUNET

ECE 110

UIUC

  1. From Hexa:

Example 7

: (storage)

Information is stored on computers with a fixednumber of bits. Show the contents of an 8-bitregister used to store (43)

10

In Hexa?

Computer Notations:1B =

1b = 1 bit (not byte)

1K =1M =1G =Example 8:

M.-C. BRUNET

ECE 110

UIUC

4 GB =?

A First Useful Circuit: for adding numbersRecall the notation for binary numbers:A = (a

n-

……a

a 1

)^02

ai^

is a binary digit (or ‘BIT’) = 0 or 1 The

decimal

value for A is: (

)^10

The

decimal

value for A is: (

)^10

a^ n-

x

n-1 2

+... + a

x 1

1 + a

x^0

Parallel Adder: adding two n-bit numbers

A = (a

n-

……a

a 1

)^02

and B = (b

n-

……b

b 1

)^02

Their sum is Sum(A,B) = S = (S

n-

……S

S 1

)^02

an-

b n-

...... a

1

b^1

a^0

b^0

carry

Parallel Adder M.-C. BRUNET

ECE 110

UIUC

S^ n-

S^1

S^0

Example 9: Add A = (1101) and B = (0111)

A^

J

B^

J

sum

In decimal:A = (

)^10

B = (

)^10

S = (

sum

S = (

)^10

a^

b^3

a^

b^2

a^

b^

a^0

b^0

carry

4-bit Parallel Adder

M.-C. BRUNET

ECE 110

UIUC

S^3

S^1

S^0

S^2

an-

b n-

...... a

1

b^1

a^

b^0

Parallel Adder: Implementation

S^ n-

S^1

S^0

carry

Parallel Adder

of inputs :

of outputs :

Using Gates

Adding two n-bit numbers

Using Blocks carry

a^ n-

b n-

......... a

1

b^1

a^

b^0

M.-C. BRUNET

ECE 110

UIUC

carry

S^ n-

S^1

S^0

E^

l^

a + b + c = (carry sum)

Full Adder: Adding 3 bits together

a^

b^

Example 10:

FA

ca

c

c

FA

FA

arrysum

arry sum

Example 11: Adding A = (110)

and B = (011) 2

2

Use a 3-bit parallel adder

b^

b^

b

a^

b^2

a^

b^1

a^0

b^0

carryFA sum

carryFA sum

carryFA sum

M.-C. BRUNET

ECE 110

UIUC

S^2

S^1

S^0

Overflow:Binary numbers are stored in registers:

y^

g

a fixed number of bits.There is overflow if the result of the additioncannot be stored back in the destination register. E^

l^

13 4 bi

i

Example 13: 4-bit registers.Numbers A and B are from example 9.

A

B

Parallel Adder

S^

(DestinationRegister)

M.-C. BRUNET

ECE 110

UIUC

Seven-segment display device

LEDs, LCDs. Displays letters, numbers, symbols.

Functioning

f^

b

a

a b c d^

g^

One segment is ON

e

d

c

d e f g

when thecorrespondinginput is equal to:

d

Example 14:

g f e d c b

a^

Displays?

M.-C. BRUNET

ECE 110

UIUC

Example 15: Analyze a Combinational Circuit

Y

f e^

b c a

a b c d e

X

g e

d

c

f g

Circuit abovedisplays something

X Y

X^

Y^

a^

b^

c^

d^

e^

f^

g^

Displays

M.-C. BRUNET

ECE 110

UIUC

Decimal Number Display

Example 16: Design a Combinational Circuit, anumber display to display all decimal numbers

abc de fg

g 7 outputs

Inputshow many?

(^

)^

(number displayed )

Ch i

a^

b^

c^

d^

e^

f^

g^

Displays

(^

)^2

= (number displayed )

10

Choice:

Blank

M.-C. BRUNET

ECE 110

UIUC

..

Design the combinational circuit such thatA B

?

abcde

g when AB = 00 (resp 01, 10, 11) it displays2 (resp.4, 6, 8) SOLUTIONS:

?

efg

a = d = e = A + B

b = A + B

c = f = A + B

g = 1

M.-C. BRUNET

ECE 110

UIUC

Note: Half Adders are no longer covered in ECE 110Prove that the implementation below iscorrect (correctly producing the outputs fora Full Adder). Labels were added to help!

c

b

a

)^

p

carHAry^ sum C

c

carry

S1carHAry^ sumS C

sum

Solution: let’s look at all the wires in the circuit; (C1, S1) = HA (a,b);(C2, S2) = HA (S1, c); check if indeed S2 is the sum of (a,b,c) andThe OR of (C1, C2) the corresponding carry. Complete solution belowHA(a,b)

HA(S1,c)

FA(a,b,c)

a b C1 S1 c C2 S2 OR(C1, C2) Carry Sum0 0

0

0

0

0

0

0

0

0

0 0

0

0

1

0

1

0

0

1

0 1

0

1

0

0

1

0

0

1

0 1

0

1

1

1

0

1

1

0

1 0

0

1

0

0

1

0

0

1

1 0

0

1

1

1

0

1

1

0

M.-C. BRUNET

ECE 110

UIUC

1 0

0

1

1

1

0

1

1

0

1 1

1

0

0

0

0

1

1

0

1 1

1

0

1

0

1

1

1

1

equal!