Uploaded by kevid36946

ECE233 Part 2

advertisement
ECE233
Project
➢
➢
➢
➢
➢
Project-1
Project-2
Project-3
Project-4
Project-5
Project 1:
Project Implementation
Aim:
 Hamming code generation, error detection and correction using
flipflops and basic gates.
Learning Outcome:
 Will be able to learn overall implementation of Hamming code
generation, error detection and correction using basic gates.
Project -2:
Practical -8:
Project Implementation
Aim:
 Design a digital calculator which can implement addition and
multiplication functions, and display output in 7- segment display
unit.
Learning Outcome:
 Will be able to implement decimal calculator having 4 bit addition
and 2 bit multiplication function and display on 7-segment
display.
Project -3:
Project Implementation
Aim:

Design a digital calculator which can implement subtraction and division
functions, and display output in 7- segment display unit.
Learning Outcome:

Will be able to implement 2 bit decimal calculator having subtractor and
division function and display on 7-segment display.
Project-4:
Practical -10:
Project Implementation
Aim:
 Design a universal counter which can perform different shift
operations using multiplexer.
Learning Outcome:

Will be able to implement universal counter using multiplexer.
Project-5:
Project Implementation
Aim:
 Design a up and down fading lights (different colored LEDs) with
specified delays using Flip- Flops/Counters .
Learning Outcome:
 Will be able to implement up and down fading lights using FlipFlop or counter.


https://www.youtube.com/watch?v=eSas_wiqlo&list=PL8VJ0UaMt6QM3Y54oLe0tUM9nIm_99WLP&ind
ex=59&t=0s
https://www.youtube.com/watch?v=zpGs7EsISq4
Project-1
Hamming Code
Error Detecting and Correcting
Code

Parity code
◦ Detect odd number of errors
◦ Cannot correct any errors

Hamming Code
◦ Detect up to two simultaneous bit errors
◦ Correct single-bit errors
Hamming Code

For each integer p > 2
◦ Code exists with m parity bits and 2p – p – 1>=m

Basically
◦
◦
◦
◦
◦
Parity bit for odd bits
Parity bit for each two bits
Parity bit for each four bits
Parity bit for each eight bits
Parity bit for each group of bits that are power of 2
 1, 2, 4, 8, 16, 32, …
Calculating Hamming Code
1.
Mark all bit positions that are powers of two parity bit
1, 2, 4, 8, 16, 32, 64, etc
2.
All other bit positions are for the data to be encoded
3, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, etc.
3.
Each parity bit calculates the parity for some of the bits in the
code word
The position of the parity bit determines the sequence of bits that it
alternately checks and skips
Position 1: check 1 bit, skip 1 bit, check 1 bit, skip 1 bit, etc.
(1,3,5,7,9,11,13,15,...)
Position 2: check 2 bits, skip 2 bits, check 2 bits, skip 2 bits, etc.
(2,3,6,7,10,11,14,15,...)
Position 4: check 4 bits, skip 4 bits, check 4 bits, skip 4 bits, etc.
(4,5,6,7,12,13,14,15,20,21,22,23,...)
Position 8: check 8 bits, skip 8 bits, check 8 bits, skip 8 bits, etc.
(8-15,24-31,40-47,...)
4.
Set a parity bit to 1 if the total number of ones in the positions it
checks is odd. Set a parity bit to 0 if the total number of ones in
the positions it checks is even
Hamming Code Layout
1
2
3
4
1
5
6
2
3
Pos
20=1
21=2
22=4
23=8
1
1
0
0
0
2
0
1
0
0
3
1
1
0
0
4
0
0
1
0
5
1
0
1
0
6
0
1
1
0
7
1
1
1
0
8
0
0
0
1
9
1
0
0
1
10
0
1
0
1
11
1
1
0
1
12
0
0
1
1
13
1
0
1
1
14
0
1
1
1
15
1
1
1
1
7
4
8
9
5
10
11
12
13
14
15
6
7
8
9
10
11
Even parity calculated for each bit position
P1 (1, 3, 5, 7, 9, 11, 13, 15)
P2 (2, 3, 6, 7, 10, 11, 14, 15)
P4 (4, 5, 6, 7, 12, 13, 14, 15)
P8(8, 9, 10, 11, 12, 13, 14, 15)
Hamming Code Layout
1
2
P1
P2
3
4
5
6
7
1
0
1
P1
P1
P2
P4
1
1
P1 = 1
P2 = 1
P4 = 0
P8 = 1
1
0
P4
0
9
10
11
12
13
14
15
0
1
1
0
1
0
1
1
P1
P1
P2
P2
P4
P4
1
0
8
P1
P2
P1
P2
P1
P2
P2
P4
P4
P4
P4
P8
P8
P8
P8
P8
P8
P8
P8
1
1
1
0
1
0
1
1
For code: 10101101011
Even parity calculated for each bit position
P1 (1, 3, 5, 7, 9, 11, 13, 15)
P2 (2, 3, 6, 7, 10, 11, 14, 15)
P4 (4, 5, 6, 7, 12, 13, 14, 15)
P8(8, 9, 10, 11, 12, 13, 14, 15)
Hamming Code (1 error)
1
2
P1
P2
3
4
5
6
7
1
0
1
P1
P1
P2
P4
Xmit
Rec
P4
9
10
11
12
13
14
15
0
1
1
0
1
0
1
1
P1
P1
P2
P2
P4
P4
8
P1
P2
P1
P2
P1
P2
P2
P4
P4
P4
P4
P8
P8
P8
P8
P8
P8
P8
P8
1
1
1
0
0
1
0
1
1
1
0
1
0
1
1
1
1
1
0
0
1
0
1
1
1
0
1
0
0
1
2, 4, and 8 incorrect
2 + 4 + 8 = 14
Even parity calculated for each bit position
c1 (1, 3, 5, 7, 9, 11, 13, 15)=1+1+1+1=0
c2 (2, 3, 6, 7, 10, 11, 14, 15)=1+1+1+1+1=1
c4 (4, 5, 6, 7, 12, 13, 14, 15)=1+1+1=1
c8(8, 9, 10, 11, 12, 13, 14, 15)=1+1+1+1+1=1
Finding and Fixing a Bad Bit
123456789012
 Transmitted word:
011100101010
 Received word:
011100101110
 Calculate the parity bits from received word
◦
◦
◦
◦
C1=P1 (1, 3, 5, 7, 9, 11) = 0+1+0+1+0+1+1=0
C2=P2 (2, 3, 6, 7, 10, 11) = 1+1+0+1++1+1=1
C3=P4 (4, 5, 6, 7, 12) = 1+0+0+1+0=0
C4=P8 (8, 9, 10, 11, 12) = 0+1+1+1+0=1
◦ Bit position 10 is incorrect c4c3c2c1=1010
Contd.
p1 =XOR of bits (3, 5, 7, 9, 11) =0
p2 =XOR of bits (3, 6, 7, 10, 11) =0
p4 =XOR of bits (5, 6, 7, 12) =1
p8 =XOR of bits (9, 10, 11, 12) =1
The 8-bit data word is written into the memory
together with the 4 parity bits as a 12-bit composite
word.
Bit position 1 2 3 4 5 6 7 8 9 10 11 12
0 0 1 1 1 0 0 1 0 1
0 0
Contd.
When the 12 bits are read from memory,
they are checked again for errors.
 The four check bits are evaluated as
follows:
C1 =XOR of bits (1, 3, 5, 7, 9, 11)
C2 =XOR of bits (2, 3, 6, 7, 10,11)
C4 =XOR of bits (4, 5, 6, 7, 12)
C8 =XOR of bits (8, 9, 10, 11, 12)

Contd.
Bit position 1
0
error
1
in bit 1
0
in bit 5
2 3 4 5 6 7 8 9 10 11 12
0 1 1 1 0 0 1 0 1 0 0 No
0 1 1 1 0 0 1 0 1
0 0 Error
0 1 1 0 0 0 1 0 1
0 0 Error
C8 C4 C2 C1
No error
0 0 0 0
Error in bit1 0 0 0 1
Error in bit5 0 1 0 1
Actual signal:10000100101
1 2 3 4 5 6
p1p2 1 p4 0 0
1 1 1 0 0 0
1 0 1 0 0 0
P1=1
P2=1
P4=0
P8=1
7
0
0
0
8 9 10 11 12 13 14 15
p8 0 1 0 0 1 0 1
1 0 1 0 0 1 0 1
1 0 1 0 0 1 0 1
c1=1+1+1+1=0
c2=1+1+1=1
c4=0+0=0
c8=1+1+1+1=0
check bits are 0010
TX
RX
Hamming Code Generation and Detection
4-bit Ripple carry full adder
1-bit full adder
Design a digital calculator which can implement addition and
multiplication functions, and display output in 7- segment display
unit.
2 bit array multiplier
w3
+
+
w3
w2
w1
2 bit binary multiplier with display
Project 3: Design a digital calculator which can implement
subtraction and division functions, and display output in 7segment display unit
4 bit Subtractor circuit
4 bit Subtractor circuit
2x2 bit division circuit
A1
A0
B1
B0
Q1
Q0
0
0
0
0
X
X
0
0
0
1
0
0
0
0
1
0
0
0
0
0
1
1
0
0
1
0
0
0
1
0
0
1
0
B1B0
A1A0 X
0
0
0
X
0
0
0
0
X
1
0
0
X
X
1
0
1
X
1
0
0
1
0
0
0
1
1
1
0
0
1
0
0
0
X
X
1
0
0
1
1
0
1
0
1
0
0
1
1
0
1
1
0
0
1
1
0
0
X
X
1
1
0
1
1
1
1
1
1
0
0
1
1
1
1
1
0
1
Q1= A1B1’
B1B0
A1A0
X
0
0
0
X
1
0
0
X
1
1
1
X
0
0
1
Q0=A1A0+A1B1+A0B1’B0
Project 4: Design a universal counter which can perform
different shift operations using multiplexer.
4 bit Asynchronous Up/Down Counter
3 bit Asynchronous Updown Counter
Link of 3 bit BCD updown counter design:
https://www.youtube.com/watch?v=8UsfRBpA6U4
4 bit universal shift Register
Project 5
Aim:
Design a up and down fading lights (different colored LEDs)
with specified delays using Flip- Flops/Counters .
Learning Outcome:
Will be able to implement up and down fading lights using
Flip-Flop or counter.
Examples: Follow the link:
https://www.youtube.com/watch?v=eSas_wiqlo&list=PL8VJ0UaMt6QM3Y54oLe0tUM9nIm_99WL
P&index=59&t=0s
https://www.youtube.com/watch?v=zpGs7EsISq4
Fading Light Circuit
Download