M6 Guide
M6 Guide
-starting from the right, place the digits under the place values
Note of the place values. Start from the rightmost digit.
-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.
-starting from the right, place the digits under the place values
Note of the place values. Start from the rightmost digit.
-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
1000111_
1101000_
1000111_
1101000_
Fill in the last bit to make the code of even parity
10001110
11010001
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)
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)
No.
Suppose you want to send this code: 11010001
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.