0% found this document useful (0 votes)
41 views

Module 8 Exercise 2.1

1. The document provides examples of converting binary numbers to decimal and decimal numbers to binary. It also explains how to add additional parity bits to binary codes to create Hamming codes and how to determine if a Hamming code is correct. 2. To create a Hamming code, additional parity bits are added in positions that are powers of 2. The values of the parity bits are calculated using even parity based on the corresponding binary digits. 3. Examples are provided of determining the correct Hamming code when the given code is found to have errors based on the parity bit values.

Uploaded by

Andrea Rhei
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views

Module 8 Exercise 2.1

1. The document provides examples of converting binary numbers to decimal and decimal numbers to binary. It also explains how to add additional parity bits to binary codes to create Hamming codes and how to determine if a Hamming code is correct. 2. To create a Hamming code, additional parity bits are added in positions that are powers of 2. The values of the parity bits are calculated using even parity based on the corresponding binary digits. 3. Examples are provided of determining the correct Hamming code when the given code is found to have errors based on the parity bit values.

Uploaded by

Andrea Rhei
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

LAMBOJO, ANDREA RHEI M. SEAT NO.

: 307
GED102-B11
MODULE 8 EXERCISE 2.1
Answer the following problems.
1. Determine the decimal number that is equivalent to each of the given
binary numbers.
a. 1001011
=1(26) + 0 (25) + 0 (24) + 1 (23) + 0 (22) + 1 (21) + 1
= 64 + 0 + 0 + 8 + 0 + 2 + 1
= 75
b. 110011
= 1 (25) + 1 (24) + 0 (23) + 0 (22) + 1 (21) + 1
= 32 + 16 + 0 + 0 + 2 + 1
= 51
c. 101101
= 1 (25) + 0 (24) + 1 (23) + 1 (22) + 0 (21) + 1
= 32 + 0 + 8 + 4 + 0 + 1
= 45

2. Convert the following decimal numbers into binary numbers:


a. 365

New decimal 365 182 91 45 22 11 5 2 1


Quotient 182 91 45 22 11 5 2 1 0
Remainder 1 0 1 1 0 1 1 1 1

= 111101101

b. 874
New decimal 874 437 218 109 54 27 13 6 3 1
Quotient 437 218 109 54 27 13 6 3 2 0
Remainder 0 1 0 1 0 1 1 0 1 1

= 1101101010
c. 1362
New decimal 136 681 340 170 85 42 10 5 2 1
2
Quotient 681 340 170 85 42 21 5 2 1 0
Remainder 0 1 0 0 1 0 0 1 1 1
= 1110010010
3. Find the sum:

a. 11001 b. 1011011
1010 10011
100011 11011110

Use the table of 5-bit codes for the letters of the alphabet to answer Problems 4
and 5.
4. Translate the following into binary codes.
a. I AM NEVER LATE IN CLASS.

01001000000000101101011100010110110001011001001100000011010000101
000000100101110000000001101100000011001110011

b. EXPERIENCE TEACHES THE BEST LESSON IN LIFE

00101110001000000101100100100100101011100001100101000001010000101
00001000110100000101100110000010100010000010100000000100010110011
10100000000110000101100111001101111011100000001001011100000001100
010010011000101

5. Translate the following binary code into English sentence.


a. 0011101111001000000000010011000010110011100110000010100010000010
1000001000001000010010110001001100001000001001011100010110011
= GOD BLESS THE PHILIPPINES
b. 0110100001010110010100000001011011000101100101100100000000010001
110100001001011110111000000000110111110101011101010010011
= MAKE EVERY ACTDWW AWZWJI
For numbers 6-8 consider the following binary code:
1100010101100
6. To form a Hamming code, how many additional bits are needed for the
given binary code?

23, 3 + 1 = 4 additional bits

7. What are the positions of the additional bits?


20=1, 21=2, 22=4, 23=8
Position 1 2 3 4 5 6 7 8 9 1 1 1 1 1 1 1 1
s 0 1 2 3 4 5 6 7
Digit P1= P2= 1 P4= 1 0 0 P8= 0 1 0 1 0 1 1 0 0
? ? ? ?

8. Find the values of the additional bits and form the Hamming code.
??1?100?010101100

P1 (1,3,5,7) = 0
P2 (2,3,6,7) = 1
P4 (4,5,6,7) = 0
P8 (8,9,10,11) = 1

= 01111001010101100

9. Find a Hamming code for each of the following binary codes.


a. 011011
Solution
22, 2 + 1 = 3
20=1, 21=2, 22=4
Positions 1 2 3 4 5 6 7 8 9
Digit P1= ? P2= ? 0 P4=? 1 1 0 1 1
??0?11011
P1 (1,3,5,7) = 1
P2 (2,3,6,7) = 1
P4 (4,5,6,7) = 0
= 110011011
b. 100110101
Solution
23, 3 + 1 = 4
20=1, 21=2, 22=4, 23=8
Positions 1 2 3 4 5 6 7 8 9 10 11 12 13
Digit P1=? P2=? 1 P4=? 0 0 1 P8=? 1 0 1 0 1
??1?001?10101
P1 (1,3,5,7) = 0
P2 (2,3,6,7) = 0
P4 (4,5,6,7) = 1
P8 (8,9,10,11) = 0
= 0011001010101
10. Suppose the following Hamming codes were created using even parity,
determine if the code is correct or not. If not correct, find the correct
Hamming code.
a. 000011001010
Solution

Parity Code Parity Value Decision


P1: 0010 1 Error
P2: 0010 1 Error
P4: 0110 0 Correct
P8: 0101 0 Correct
P1 and P2 = 2 + 1 = 3rd Position

The correct Hamming code: 001011001010

b. 101110001100
Solution

Parity Code Parity Value Decision


P1: 1110 1 Error
P2: 0100 1 Error
P4: 1100 0 Correct
P8: 0110 0 Correct
P1 and P2 = 2 + 1 = 3 rd Position
The correct Hamming code: 100110001100
c. 010101100011
Solution

Parity Code Parity Value Decision


P1: 0001 1 Error
P2: 1011 1 Error
P4: 1011 1 Error
P8: 0001 1 Error
9th Position
The correct Hamming code: 010101101011

You might also like