☰ Year plan · Communication Technology

Binary and decimal numbers

Week 3 · Unit 1 Number systems (3): binary to decimal and decimal to binary · 3 lessons
3

First and last remainder: LSB, MSB and checking back

ICT Secondary 3 Term 1, Unit 1, Topic 1: pp. 14–17
GoalName the first and last bit of a binary number and check an answer by converting back.
New words
LSB · least significant bit: the bit on the right, worth only 1MSB · most significant bit: the bit on the left, with the largest place valuecheck · a second calculation that confirms an answer
Explanation

In a binary number the bit on the right is the least significant bit (LSB): it is worth only 1, and it is the first remainder of the divisions. The bit on the left is the most significant bit (MSB): it has the largest place value and it is the last remainder. Without leading zeros the MSB is always 1. The LSB tells us whether the number is even or odd, because every other place value (2, 4, 8 …) is even: a binary number is even when its LSB is 0 and odd when its LSB is 1. Always check a conversion by going back. A second way to find the bits is to subtract place values: for each place, from the largest down, write 1 if the place value fits in what is left and subtract it, otherwise write 0. For 77 the steps are in the table, and they give (1001101)₂. Check: 64 + 8 + 4 + 1 = 77.

Place value6432168421
Number left77131313511
Fits?yesnonoyesyesnoyes
Bit1001101
Worked examples
Reading orderBitsValueEquals 100?
top to bottom001001119no
bottom to top1100100100yes
Mona converts 100 and reads the remainders from top to bottom: 0010011. Going back, 16 + 2 + 1 = 19, not 100, so the check catches the mistake. From bottom to top the bits are 1100100 and 64 + 32 + 4 = 100.
BinaryLSBDecimalEven or odd?
1011010090even
1011011191odd
The binary numbers 1011010 and 1011011 differ only in the LSB. With LSB 0 the number is 64 + 16 + 8 + 2 = 90, which is even; with LSB 1 it is 91, which is odd.
Php
1<?php
2echo decbin(77), "\n";
3echo bindec("1001101");
Output
1001101
77
The ready functions decbin and bindec do the same conversions, so they are good for checking a hand answer, not for replacing it. This program prints the binary form of 77 and the decimal value of 1001101.
Class activity

Choose a decimal number between 20 and 60. Convert it to binary twice, once by repeated division by 2 and once by subtracting place values. Compare the answers, name the LSB and the MSB, and check by converting back.

Practice
1
What are the LSB and the MSB of 10011?
2
Is (110100)₂ even or odd? How can you tell without converting?
3
Convert 53 to binary by subtracting place values, then check back.
4
What is the place value of the MSB of an 8-bit number?