CH 01 : Binary Systems And Hexadecimal

The Binary System

  • ==Binary System==: A system of ones(1) and zeroes(0) which is the building block in a computer.

    • Computers have millions of tiny switches which can either be in an ON or OFF position.
    • 1 represents ON and 0 represents OFF position of a switch.
    • Different combinations of these 1s and 0s hold different meanings to a computer.
  • Binary is a number system based on the number ^^2,^^ i.e it counts in multiples of 2. Like 2,4,8,16 and so on.

    <br />

  • Example use of Binary:

    • If the register contains 1 0 1 0 1 0 1 0 this means ‘motor B is ON and motor C is ON and both motors are turning to produce FORWARDS motion’. Effectively, the vacuum cleaner is moving forwards.

Conversions Between Binary And Denary

  • ==Denary==: A number system with a base of ^^10.^^
  • While converting a Binary value to Denary, always begin from the ^^right hand side.^^
    • Substitute the values with ^^powers^^ of 2 , starting from 2^0
    • Add all the values in places of 1s only for the denary value. Using 00101101 as an example:
00101101
2^7 = 1282^6 = 642^5 = 322^4 = 162^3 = 82^2 = 42^1 = 22^0 = 1
 32 + 8 + 4 + 1 = 45
  • In order to convert a Denary number to a Binary value, ^^repetitive division^^ is used. Using 107 as an example:


Measurement Of The Size Of Computer Memories

  • ==Bit==: One Binary digit.
  • ==Byte==: 8 Bits make up a Byte.
    • Some computers also use larger Bytes but their Bits are always in multiples of 8.
  • Different memory sizes:
Name Of Memory SizeNumber Of BitsNumber Of Bytes
1 Kilobyte (KB)2^101024
1 Megabyte (MB)2^201024^2
1 Gigabyte (GB)2^301024^3
1 Terabyte (TB)2^401024^4
1 Petabyte (PB)2^501024^5

The Hexadecimal System

  • ==Hexadecimal System==: A number system with base ^^16^^, thus every digit is represented by 16 values. Its also called ==‘Hex’.==
  • The table for ^^equal^^ values of Binary, Denary and Hex:
BinaryDenaryHexadecimal
000000
000111
001022
001133
010044
010155
011066
011q77
100088
100199
101010A
101111B
110012C
110113D
111014E
111115F

Conversions Between Binary And Hexadecimal

  • Converting from Binary to Hexadecimal is a fairly easy process.
  • ^^Starting from the right^^ and moving left, split the binary number into groups of ^^4 bits^^. If the last group has less than 4 bits, then simply fill in with 0s from the left.
  • Take each group of 4 bits and convert it into the ^^equivalent^^ hexadecimal digit using the table.
  • To convert from Hex to Binary, simply look at the corresponding values in the table.

Conversions Between Hexadecimal And Denary

  • To convert from Hex to Denary, use the same method as when converting from Binary to Denary, except using the ^^powers^^ of 16 instead of 2 this time. Add the total to get the Denary value.
  • In conversion from Denary to Hex, yet again a familiar method is used.
    • Repeatedly divide the number by 16.
    • Read the remainders from the ^^bottom^^.
    • Replace two digit numbers with Hex values.

Uses Of Hexadecimal System

  • ==Memory Dumps==: The contents from the computer memory which are being sent to a printer or monitor etc.
    • Hex is used as it takes ^^lesser space^^ than Binary and is ^^easier^^ to use.
    • It is also used to ^^trace errors^^ in softwares and programs.
    • It can represent the ^^location^^ of contents in computer memory.
  • ==Hyper Text Markup Language (HTML):== A markup language used in developing web pages.
    • Hex values are used to store colours of text.
  • ==Media Access Control (MAC)==: A unique address given to a device to identify it on the Internet.
    • It refers to the ^^Network Interface Card (NIC)^^ of the device.
    • Made of 48 Bits shown as 6 groups of Hex Digits.
    • Form: ^^NN – NN – NN – DD – DD – DD or NN:NN:NN:DD:DD:DD^^
    • The first half is identity number of manufacturer and second half is serial number of the device.
    • Two types of MAC addresses, ==Universally Administered MAC Address (UAA)== and ==Locally Administered MAC Address (LAA).==
    • ==UAA:== Common and set by the manufacturer at the factory. Very rarely changed.
    • ==LAA==: Set by an organisation when a change of MAC address may be needed. The possible reasons for this might be:
    • Certain software used on mainframe systems needing all the MAC addresses of devices to fall into a ^^strict format.^^
    • To bypass a MAC address ^^filter^^ on a router or a firewall for security reasons.
    • To get past certain types of network ^^restrictions^^.
  • Web Addresses:
    • ==ASCII Code==: A code written in Hex and given to each character on a keyboard.
    • Used in representing web addresses in URLs.
  • Assembly and Machine Code: True codes are written in Binary but as it is more ^^error prone, time consuming and complicated,^^ Hexadecimal is used by programmers.

\