Sie sind auf Seite 1von 3

Data Representation

Binary and Hexadecimal Numbers


Bit Patterns
Storage locations in digital computers are built using circuits that can exist in two states, low voltage and
high voltage, 0 being low voltage, and 1 being high voltage. This is known as a binary system. The smallest
possible storage location contains either a 0 or a 1. A binary digit, or bit, is a 0 or a 1, a group of 8 bits is
called a byte, and a group of bytes is known as a word.

Pure Binary Representation of Denary Numbers


A denary system uses the numbers 0-9 to represent numbers, when moving left to right, each number
represents 10 times as much as the previous, known as base ten. Using the binary system, or base 2,
moving from left to right, each number is worth 2 times as much as the previous one.

128

64

32

16

Denary numbers are converted into binary by moving from left to right, and seeing which binary column fits
into the number, and then subtracting that number, and repeating the process, putting a 1 under the
heading wherever a number fits into the column. And putting a 0 where it does, resulting a binary number. To
convert from binary to denary, simply place headings as shown over the binary number, adding where there
is a one, so in this case, the number represented in binary is, 128+64+16+8+1=217.

Binary Arithmetic
0

Answe
r

Carry

Binary is added similarly to denary, numbers greater than the value are carried over, In this case, when a 0 is
added to a 1, the result is a 1, when 1 is added to a 1, the result is 0, carrying the one, when a 1 is added to
a 1 while having a carried 1, the result is 1 carrying the 1.

11

11

Binary multiplication involves a similar process to denary multiplication, resulting in the ones being
multiplied by each number, and then added.

Representation of signed integers by Twos Complement


Twos complement is a way to represent binary numbers as negative or positive numbers, this is done easily
by covering the first one, and then reversing the rest. Resulting in the twos complement of a number, this
can then be used in addition to subtract two numbers.

To convert to twos complement, change all 0s to 1s and vice versa, and then add 1 to the result. To change
the sign of a number cover all digits up to the first 1, and then flip all other digits. To subtract, add the two
numbers. A negative number always has 1 as the most significant bit, and an odd number always has 1 as
the least significant bit.

The Concept of Number Bases: Denary, Binary and Hexadecimal


To make it easier to read the contents of the main memory binary numbers are displayed in Hexadecimal.
Hexadecimal numbers are in base 16, using the digits 0 to 9, and the letters A-F.

Denary

1 2

10

11

12

13

14

15

16

Binary

1
1
0

1
1

1
0
0

1
0
1

1
1
0

1
1
1

10
00

10
01

10
10

10
11

11
00

11
01

11
10

11
11

10
00
0

Hexad
ecimal

1 2

10

To convert from denary to hexadecimal, first convert the denary numbers to binary, then split the numbers
into groups of 4 adding the left side together and dividing by 16, and adding the right and expressing as
hexadecimal.
To convert from hexadecimal to denary, split the hex into two groups, and express each side as binary.

Integers and Numbers with a Fractional Part

Das könnte Ihnen auch gefallen