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

M6 Guide

The document provides examples and steps for converting binary numbers to decimal and vice versa, describes binary logic operations like AND, OR, and inversion, and covers topics in error detection and correction such as parity, repetition coding, cyclic redundancy checks, and Hamming codes.

Uploaded by

Rendell Lauren
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views

M6 Guide

The document provides examples and steps for converting binary numbers to decimal and vice versa, describes binary logic operations like AND, OR, and inversion, and covers topics in error detection and correction such as parity, repetition coding, cyclic redundancy checks, and Hamming codes.

Uploaded by

Rendell Lauren
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 49

GED0027

Module 6 Supplementary Guide


Binary Number System
Note of the place values. Start from the rightmost digit.

512 256 128 64 32 16 8 4 2 1


Note of the place values. Start from the rightmost digit.

512 256 128 64 32 16 8 4 2 1

Example: convert the binary number 1101001 to decimal.


Note of the place values. Start from the rightmost digit.

512 256 128 64 32 16 8 4 2 1


1 1 0 1 0 0 1

Example: convert the binary number 1101001 to decimal.

-starting from the right, place the digits under the place values
Note of the place values. Start from the rightmost digit.

512 256 128 64 32 16 8 4 2 1


1 1 0 1 0 0 1

Example: convert the binary number 1101001 to decimal.

-starting from the right, place the digits under the place values
-add the place values of the 1’s
64 + 32 + 8 + 1 = 𝟏𝟎𝟓
Note of the place values. Start from the rightmost digit.

512 256 128 64 32 16 8 4 2 1

Example: convert the binary number 111000010 to decimal.


Note of the place values. Start from the rightmost digit.

512 256 128 64 32 16 8 4 2 1


1 1 1 0 0 0 0 1 0

Example: convert the binary number 111000010 to decimal.

-starting from the right, place the digits under the place values
Note of the place values. Start from the rightmost digit.

512 256 128 64 32 16 8 4 2 1


1 1 1 0 0 0 0 1 0

Example: convert the binary number 111000010 to decimal.

-starting from the right, place the digits under the place values
-add the place values of the 1’s
256 + 128 + 64 + 2 = 450
19 610
610 ÷ 2 = 305 𝑟. 0
Divide repeatedly by 2 and write 305 ÷ 2 = 152 𝑟. 1
the quotient and remainder until 152 ÷ 2 = 76 𝑟. 0
the quotient is 0. 76 ÷ 2 = 38 𝑟. 0
19 ÷ 2 = 9 𝑟. 1 38 ÷ 2 = 19 𝑟. 0
9 ÷ 2 = 4 𝑟. 1 19 ÷ 2 = 9 𝑟. 1
4 ÷ 2 = 2 𝑟. 0 9 ÷ 2 = 4 𝑟. 1
2 ÷ 2 = 1 𝑟. 0 4 ÷ 2 = 2 𝑟. 0
1 ÷ 2 = 0 𝑟. 1 2 ÷ 2 = 1 𝑟. 0
1 ÷ 2 = 0 𝑟. 1
Copy from bottom, up.
Thus 19 in binary is 10011 Thus 610 in binary is 1001100010
111 11

1110001 1000110
+ 1000111 + 10111
10111000 1011101
Binary Codes and
Binary Logic
Fluffy ~
Fluffy ~
01000110 01101100 01110101 01100110 01100110 01111001 00100000 01111110
AND OR Inverse

1 AND 1 = 1 1 OR 1 = 1 1’ = 0
1 AND 0 = 0 1 OR 0 = 1 0’ = 1
0 AND 1 = 0 0 OR 1 = 1
0 AND 0 = 0 0 OR 0 = 0
AND OR Inverse

1 AND 1 = 1 1 OR 1 = 1 1’ = 0
1 AND 0 = 0 1 OR 0 = 1 0’ = 1
0 AND 1 = 0 0 OR 1 = 1
0 AND 0 = 0 0 OR 0 = 0
AND OR Inverse

1 AND 1 = 1 1 OR 1 = 1 1’ = 0
1 AND 0 = 0 1 OR 0 = 1 0’ = 1
0 AND 1 = 0 0 OR 1 = 1
0 AND 0 = 0 0 OR 0 = 0
Example: x = 10111000 y=11000001
AND OR Inverse

1 AND 1 = 1 1 OR 1 = 1 1’ = 0
1 AND 0 = 0 1 OR 0 = 1 0’ = 1
0 AND 1 = 0 0 OR 1 = 1
0 AND 0 = 0 0 OR 0 = 0
Example: x = 10111000
y = 11000001

x AND y = 10000000
AND OR Inverse

1 AND 1 = 1 1 OR 1 = 1 1’ = 0
1 AND 0 = 0 1 OR 0 = 1 0’ = 1
0 AND 1 = 0 0 OR 1 = 1
0 AND 0 = 0 0 OR 0 = 0
Example: x = 10111000
y = 11000001

x OR y = 11111001
AND OR Inverse

1 AND 1 = 1 1 OR 1 = 1 1’ = 0
1 AND 0 = 0 1 OR 0 = 1 0’ = 1
0 AND 1 = 0 0 OR 1 = 1
0 AND 0 = 0 0 OR 0 = 0
Example: x = 10111000
y = 11000001

x’ = 01000111
Error Detection and
Correction
Identify the parity of the given 8-bit codes

11010001

10011101

10110000
Identify the parity of the given 8-bit codes

11010001 (has four 1s, thus even parity)

10011101 (has five 1s, thus odd parity)

10110000 (has three 1s, thus odd parity)


Fill in the last bit to make the code of even parity

1000111_
1101000_

Fill in the last bit to make the code of odd parity

1000111_
1101000_
Fill in the last bit to make the code of even parity

10001110
11010001

Fill in the last bit to make the code of odd parity

10001111
11010000
If the given message is sent with even parity, will an error be detected? On
which character? (each 8-bit code represents one character)

11100100 10110011 10110010


If the given message is sent with even parity, will an error be detected? On
which character? (each 8-bit code represents one character)

11100100 10110011 10110010

Yes, on the 2nd character


If the given message is sent with even parity, will an error be detected? On
which character? (each 8-bit code represents one character)

11100100 10010011 10110010


If the given message is sent with even parity, will an error be detected? On
which character? (each 8-bit code represents one character)

11100100 10010011 10110010

No.
If the given message is sent with odd parity, will an error be detected? On
which character? (each 8-bit code represents one character)

11100100 10110011 10110010


If the given message is sent with odd parity, will an error be detected? On
which character? (each 8-bit code represents one character)

11100100 10110011 10110010

Yes, on the 1st and 3rd character


If the given message is sent with odd parity, will an error be detected? On
which character? (each 8-bit code represents one character)

11000100 10011011 10000000


If the given message is sent with odd parity, will an error be detected? On
which character? (each 8-bit code represents one character)

11000100 10011011 10000000

No.
Suppose you want to send this code: 11010001

Using repetition, how will it be sent?


Suppose you want to send this code: 11010001

Using repetition, how will it be sent?

111 111 000 111 000 000 000 111


Suppose you received this code that used repetition. Using the majority rule,
correct the detected error.

111 101 000 111 100 000 000 111


Suppose you received this code that used repetition. Using the majority rule,
correct the detected error.

111 101 000 111 100 000 000 111


Suppose you received this code that used repetition. Using the majority rule,
correct the detected error.

111 111 000 111 000 000 000 111


Suppose you received this code that used repetition. Using the majority rule,
correct the detected error.

111 111 000 111 000 000 000 111

So, what was the corrected and decoded message?


Suppose you received this code that used repetition. Using the majority rule,
correct the detected error.

111 111 000 111 000 000 000 111

So, what was the corrected and decoded message?

11010001
Given a 4-bit code to be sent,
1. Use 1001 as a CRC divisor
2. Add 3 zeroes to the 4-bit code
3. Divide the first bits
4. Multiply the quotient to the divisor
5. Subtract (except the first bits)
6. Repeat until only the last 3-bits are left as remainder
7. Attach the remainder at the end of the 4-bit code
8. You get the 7-bit code to be sent with the checksum
Received a 7-bit code with checksum,
1. Use 1001 as a CRC divisor
2. Divide the first bits
3. Multiply the quotient to the divisor
4. Subtract (except the first bits)
5. Repeat until only the last 3-bits are left as remainder
6. If the remainder is 000, then there is no error. Otherwise,
there is error.
7. If there is no error, Remove the last 3 bits to get the
original 4-bit code.
Given an 8-bit code,
1. From left to right, arrange them in position except for the powers of 2
positions, which are for the check bits.
12 11 10 9 8 7 6 5 4 3 2 1

2. Fill in the check bits to match each group to the assigned parity.

0 1 0 1 0 0 1 0 1 1 1 1
b12 b11 b10 b9 c8 b7 b6 b5 c4 b3 c2 c1
12 11 10 9 8 7 6 5 4 3 2 1
Received a 12-bit Hamming code
1. Check the parity of each group

0 1 0 1 0 0 1 0 1 1 1 1
b12 b11 b10 b9 c8 b7 b6 b5 c4 b3 c2 c1
12 11 10 9 8 7 6 5 4 3 2 1

2. Create a 4-digit binary number starting from the group with the check bit
in the 8th position. Write 1 if the parity does not match and 0 otherwise.
3. Convert the binary number to decimal
4. Correct the bit in that position
5. Remove the check bits to get the original 8-bit code.

You might also like