Binary
Binary
BSHRM IIA
Binary
Binary is a base 2 number system invented by Gottfried Leibniz where numeric
values are represented by different combinations of 0 and 1, also known as OFF or
ON. The primary language of computers, binary is still used in today's machines
because it's a simple and elegant design. Binary's 0 and 1 method is efficient at
detecting an electrical signal's off or on state, or magnetic poles in media like hard
drives. It is also the most efficient way to control logic circuits.
23
8
1
22
4
0
21
2
0
The next example is 11111111 in binary, the maximum 8-bit value of 255. Again,
reading right to left we have 1 + 2 + 4 + 8 + 16 + 32 + 64 + 128 = 255.
Value:
128
64
32
16
8
ON/OFF:
1
1
1
1
1
4
1
Decimal
Decimal is a term that describes the base-10 number system, probably the most
commonly used number system. The decimal number system consists of ten
single- digit numbers: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. The number after 9 is 10. The
number after 19 is 20 and so forth. Additional powers of 10 require the addition of
another positional digit.
2
1
Decimal
Binary
Octal
Hexadecimal
10
11
100
101
110
111
1000
10
1001
11
10
1010
12
11
1011
13
12
1100
14
13
1101
15
14
1110
16
15
1111
17
16
10000
20
10
17
10001
21
11
etc
etc
etc
etc
Optical
In general, optical or optical technology refers to anything that relates to light or
vision, whether it be visible light or infrared light that performs a specific function.
For example, optical fiber, like that shown to the right is a type of wire commonly
made out of glass or plastic that carries light signals. These signals can be
interpreted by a computer as data (binary) and is one example of how data can be
transferred over a network.
A computer mouse is an example of an optical device that uses optical technology.
It uses a light-emitting diode and photodiodes to determine the direction a mouse is
moving across a surface. This then allows the computer to move the mouse cursor
across the computer screen in the appropriate direction. An optical mouse works
best on an opaque surface, where it can detect the direction of movement. Surfaces
like glass and a mirror are not viable surfaces to use an optical device on since
movement cannot be detected. Newer optical mice employ the use of a laser diode
for increased resolution and movement precision.
Optical storage devices use optical technology to save and retrieve data on
discs, like a Blu-ray, CD, DVD. The device uses a laser light to read information on
the disc and to "write" new information to the disc for future retrieval.
Hexadecimal
Hexadecimal describes a base-16 number system. That is, it describes a numbering
system containing 16 sequential numbers as base units (including 0) before adding
a new position for the next number. (Note that we're using "16" here as a decimal
number to explain a number that would be "10" in hexadecimal.) The hexadecimal
numbers are 0-9 and then use the letters A-F. We show the equivalence of binary,
decimal, and hexadecimal numbers in the table below.
Hexadecimal is a convenient way to express binary numbers in modern computers
in which a byte is almost always defined as containing eight binary digits. When
showing the contents of computer storage (for example, when getting a core
dump of storage in order to debug a new computer program or when expressing a
string of text characters or a string of binary values in coding a program or HTML
page), one hexadecimal digit can represent the arrangement of four binary digits.
Two hexadecimal digits can represent eight binary digits, or a byte.
Binary
Decimal
Hexadecimal
10
11
100
101
110
111
1000
1001
1010
10
1011
11
1100
12
1101
13
1110
14
1111
15
10000
16
10
10001
17
11
etc
etc
etc
Conversion
Data conversion is the conversion of computer data from one format to another.
Throughout a computer environment, data is encoded in a variety of ways. For
example, computer hardware is built on the basis of certain standards, which
requires that data contains, for example, parity bit checks.
There are many methods or techniques which can be used to convert numbers
from one base to another. We'll demonstrate here the following:
Step 1 - Divide the decimal number to be converted by the value of the new
base.
Step 2 - Get the remainder from Step 1 as the rightmost digit (least
significant digit) of new base number.
Step 3 - Divide the quotient of the previous divide by the new base.
Step 4 - Record the remainder from Step 3 as the next digit (to the left) of
the new base number.
Repeat Steps 3 and 4, getting remainders from right to left, until the quotient
becomes zero in Step 3.
The last remainder thus obtained will be the most significant digit (MSD) of the new
base number.
Example
Decimal Number : 2910
Operation
Result
Remainder
Step 1
29 / 2
14
Step 2
14 / 2
Step 3
7/2
Step 4
3/2
Step 5
1/2
Step 1 - Determine the column (positional) value of each digit (this depends
on the position of the digit and the base of the number system).
Step 2 - Multiply the obtained column values (in Step 1) by the digits in the
corresponding columns.
Step 3 - Sum the products calculated in Step 2. The total is the equivalent
value in decimal.
Example
Binary Number : 111012
Calculating Decimal Equivalent:
Step
Binary
Number
Decimal Number
Step 1
111012
Step 2
111012
(16 + 8 + 4 + 0 + 1)10
Step 3
111012
2910
Step 2 - Convert the decimal number so obtained to the new base number.
Example
Octal Number : 258
Calculating Binary Equivalent:
Octal
Number
Decimal Number
Step 1
258
Step 2
258
(16 + 5 )10
Step 3
258
2110
Operation
Result
Remainder
Step 1
21 / 2
10
Step 2
10 / 2
Step 3
5/2
Step 4
2/2
Step 5
1/2
Step 1 - Divide the binary digits into groups of three (starting from the
right).
Step 2 - Convert each group of three binary digits to one octal digit.
Example
Binary Number : 101012
Calculating Octal Equivalent:
Step
Binary Number
Octal Number
Step 1
101012
010 101
Step 2
101012
28 58
Step 3
101012
258
Step 1 - Convert each octal digit to a 3 digit binary number (the octal digits
may be treated as decimal for this conversion).
Step 2 - Combine all the resulting binary groups (of 3 digits each) into a
single binary number.
Example
Octal Number : 258
Calculating Binary Equivalent:
Step
Octal Number
Binary Number
Step 1
258
210 510
Step 2
258
0102 1012
Step 3
258
0101012
Step 1 - Divide the binary digits into groups of four (starting from the right).
Example
Binary Number : 101012
Calculating hexadecimal Equivalent:
Step
Binary Number
Hexadecimal Number
Step 1
101012
0001 0101
Step 2
101012
110 510
Step 3
101012
1516
Step 2 - Combine all the resulting binary groups (of 4 digits each) into a
single binary number.
Example
Hexadecimal Number : 1516
Calculating Binary Equivalent:
Step
Hexadecimal Number
Binary Number
Step 1
1516
110 510
Step 2
1516
00012 01012
Step 3
1516
000101012