Number Systems: Comprehensive Binary and Denary Guide

Fundamentals of Binary Representation

  • Necessity of Conversion: Any form of data must be converted into a binary format so that it can be processed by a computer system.
  • The Basic Building Block: Regardless of how complex a computer system is, the basic building block of all computers is the binary number system.
  • System Rationale: The binary system is chosen because it consists only of 11s and 00s.
  • Physical Representation (Switches):     * Computers contain millions of tiny "switches."     * These switches must be in an ON or OFF position.     * A switch in the ON position is represented by the digit 11.     * A switch in the OFF position is represented by the digit 00.
  • Logic Gates: The switches used in a computer make use of logic gates to store and process data.

The Denary (Base 10) Number System

  • Definition: Denary is the standard system used in everyday counting, which operates in multiples of 1010.
  • Digits: It uses ten separate digits, 00 through 99, to represent all possible values.
  • Base Type: It is known as a "base 10" number system.
  • Column Headings (Place Values): The system uses powers of 1010 to determine column values:     * (104)(10^4) = 1000010000     * (103)(10^3) = 10001000     * (102)(10^2) = 100100     * (101)(10^1) = 1010     * (100)(10^0) = 11
  • Example Representation: A number like 2517725177 is composed of the digits 2,5,1,7,72, 5, 1, 7, 7 placed in their respective power-of-ten columns.

The Binary (Base 2) Number System

  • Definition: The binary system is a "base 2" number system.
  • Values: Only two digits, 00 and 11, are used to represent all values.
  • Column Headings (Place Values): Following the same logic as denary, the place values are powers of 22 (20,21,22,232^0, 2^1, 2^2, 2^3, etc.).
  • 8-Bit Binary Headings: A standard 8-bit binary number uses the following column values:     * (27)(2^7) = 128128     * (26)(2^6) = 6464     * (25)(2^5) = 3232     * (24)(2^4) = 1616     * (23)(2^3) = 88     * (22)(2^2) = 44     * (21)(2^1) = 22     * (20)(2^0) = 11
  • Example Binary Number: 1110111011101110.

Converting Binary to Denary

  • The Conversion Process: Every time a 11 appears in a binary column, the heading value of that column is added to a running total. If a 00 appears, the value of that column is ignored.
  • Example 1: 8-Bit Conversion     * Binary: 1110111011101110     * Breakdown: (1×128)+(1×64)+(1×32)+(0×16)+(1×8)+(1×4)+(1×2)+(0×1)(1 \times 128) + (1 \times 64) + (1 \times 32) + (0 \times 16) + (1 \times 8) + (1 \times 4) + (1 \times 2) + (0 \times 1)     * Calculation: 128+64+32+8+4+2=238128 + 64 + 32 + 8 + 4 + 2 = 238
  • Example 2: 12-Bit Conversion     * Binary: 011110001011011110001011     * Column Headings: 2048,1024,512,256,128,64,32,16,8,4,2,12048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1     * Calculation: 1024+512+256+128+8+2+1=19311024 + 512 + 256 + 128 + 8 + 2 + 1 = 1931

Converting Denary to Binary

There are two primary methods for converting denary numbers into binary numbers.

Method 1: Successive Subtraction of Powers of 2
  • Process: Subtract the largest possible power of 22 from the denary number and place a 11 in that corresponding binary column. Repeat the process with the remainder until the value reaches 00. Any column not used receives a 00.
  • Example: Denary 142     1. 142−128=14142 - 128 = 14 (128 column gets a 11)     2. 14−8=614 - 8 = 6 (8 column gets a 11)     3. 6−4=26 - 4 = 2 (4 column gets a 11)     4. 2−2=02 - 2 = 0 (2 column gets a 11)     * Result: 1000111010001110
  • Example: Denary 59     1. 59−32=2759 - 32 = 27 (32 column gets a 11)     2. 27−16=1127 - 16 = 11 (16 column gets a 11)     3. 11−8=311 - 8 = 3 (8 column gets a 11)     4. 3−2=13 - 2 = 1 (2 column gets a 11)     5. 1−1=01 - 1 = 0 (1 column gets a 11)     * Result: 0011101100111011 (Two 00s added to the left to complete the 8-bit format).
  • Example: Denary 35,000 (16-Bit)     1. 35000−32768=223235000 - 32768 = 2232     2. 2232−2048=1842232 - 2048 = 184     3. 184−128=56184 - 128 = 56     4. 56−32=2456 - 32 = 24     5. 24−16=824 - 16 = 8     6. 8−8=08 - 8 = 0     * Result: 10001000101110001000100010111000
Method 2: Successive Division by 2
  • Process: Divide the denary number by 22 and record the remainder (even if it is 00). Continue dividing the result by 22 until the result is zero. Read the remainders in reverse order (bottom to top) to find the binary number.
  • Example: Denary 142     * 142÷2=71142 \div 2 = 71, remainder: 00     * 71÷2=3571 \div 2 = 35, remainder: 11     * 35÷2=1735 \div 2 = 17, remainder: 11     * 17÷2=817 \div 2 = 8, remainder: 11     * 8÷2=48 \div 2 = 4, remainder: 00     * 4÷2=24 \div 2 = 2, remainder: 00     * 2÷2=12 \div 2 = 1, remainder: 00     * 1÷2=01 \div 2 = 0, remainder: 11     * Reading bottom to top: 1000111010001110
  • Example: Denary 35,000     * 35000÷2=1750035000 \div 2 = 17500, remainder: 00     * 17500÷2=875017500 \div 2 = 8750, remainder: 00     * 8750÷2=43758750 \div 2 = 4375, remainder: 00     * 4375÷2=21874375 \div 2 = 2187, remainder: 11     * 2187÷2=10932187 \div 2 = 1093, remainder: 11     * 1093÷2=5461093 \div 2 = 546, remainder: 11     * 546÷2=273546 \div 2 = 273, remainder: 00     * 273÷2=136273 \div 2 = 136, remainder: 11     * 136÷2=68136 \div 2 = 68, remainder: 00     * 68÷2=3468 \div 2 = 34, remainder: 00     * 34÷2=1734 \div 2 = 17, remainder: 00     * 17÷2=817 \div 2 = 8, remainder: 11     * 8÷2=48 \div 2 = 4, remainder: 00     * 4÷2=24 \div 2 = 2, remainder: 00     * 2÷2=12 \div 2 = 1, remainder: 00     * 1÷2=01 \div 2 = 0, remainder: 11     * Reading bottom to top: 10001000101110001000100010111000

Practice Activities and Problems

Activity 1.1: Binary to Denary Conversion List

Convert the following binary strings into their base 10 equivalents:

  • a. 0011001100110011
  • b. 0111111101111111
  • c. 1001100110011001
  • d. 0111010001110100
  • e. 1111111111111111
  • f. 0000111100001111
  • g. 1000111110001111
  • h. 1011001110110011
  • i. 0111000001110000
  • j. 1110111011101110
  • k. 000111100111000111100111
  • l. 010101010100010101010100
  • m. 111100001111111100001111
  • n. 011111001000011111001000
  • o. 011111111111011111111111
  • p. 01111100111100000111110011110000
  • q. 00111111000011010011111100001101
  • r. 11000011001111111100001100111111
  • s. 10001000100010001000100010001000
  • t. 01111111111111110111111111111111
Activity 1.2: Denary to Binary Conversion List

Convert the following denary numbers into binary using both Method 1 and Method 2:

  • a. 4141
  • b. 6767
  • c. 8686
  • d. 100100
  • e. 111111
  • f. 127127
  • g. 144144
  • h. 189189
  • i. 200200
  • j. 255255
  • k. 3300033000
  • l. 888888
  • m. 40954095
  • n. 1640016400
  • o. 6230762307