0% found this document useful (0 votes)
1 views

Binary

The document explains the binary number system, detailing its significance in digital computing and the conversion between binary and decimal systems. It covers concepts such as two's complement for representing negative integers, fixed-point binary fractions, and floating-point binary notation for real numbers. Additionally, it provides examples of conversions and the representation of numbers in binary format, emphasizing the importance of place values and the structure of binary numbers.

Uploaded by

FoFi
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views

Binary

The document explains the binary number system, detailing its significance in digital computing and the conversion between binary and decimal systems. It covers concepts such as two's complement for representing negative integers, fixed-point binary fractions, and floating-point binary notation for real numbers. Additionally, it provides examples of conversions and the representation of numbers in binary format, emphasizing the importance of place values and the structure of binary numbers.

Uploaded by

FoFi
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

Binary:

The binary number system is fundamental to the operation of the modern digital computer binary is also
known as the base to number system understanding the base 10 system which is sometimes called the
decimal system.

To convert numbers from one base to another in base ten we have ten shapes representing the numbers
nought to nine the concept of zero is a very important aspect of this system these shapes are known as
digits why base 10 probably because most of us have 10 fingers on our hands any whole number can be
represented using combinations of these digits the bigger the number the more of these digits.

The positions of the digits mean something this number system is known as a positional number system
consider the number 537 from a very young age you will probably taught that each digit has a place
value 537 is actually 5 times 100 plus 3 times 10 plus 7 times 1 for bigger numbers, we could use more
place values if we have zeros underneath these higher place values, they're insignificant so this is still the
number 537.

In base 2 namely binary we have only two shapes representing 0 and 1 these binary digits are known as
bits for short any number can be represented using combinations of bits base 2 because inside a
computer. If there's an electrical voltage on a wire transmitting a 1 if there's no voltage the wire is
transmitting 0 for an electronic computer the binary number system is a natural fit the positions of the
bits also means something in binary binary is also a positional number system here's an 8-bit binary
number each bit has a place value but unlike base 10 in which these place values increase from right to
left in powers of 10 these are increasing in powers of 2 each place value is double that of the previous
place value, what we have now then is a little gadget that we can use to convert a binary number into
denary this binary number is comprised of actually the largest binary number that can represent using 8
bits let's.

If you're asked to perform a conversion in an examination for example to convert this binary number into
denary, here are some examples.

However, asked to convert from denary to binary, slightly different the first thing we have to decide
where we're going to place the first one starting from left to right if we were to place a 1 underneath 128
the number would be at 49 so we might try a 1 underneath 32 is less than 49 so we're going to put a 1
here and we know need to add something else to it so we'll try a 1 underneath the next place value
which is 16, 32 plus 16 is 48 are below the target so we can add something else to this if we were to
place a 1 underneath the 8 ,32 plus 16 plus 8 is too big so we won't place the 1 here let's try it
underneath the 4, 32 plus 16 plus 4 is still too big so let's try the 1 underneath the 2, 32 plus 6 + 2 is 50
it's still too big so let's try the next position along 32 plus 16 plus 1 is 49 we found the target value, all we
have to do now is fill the gaps with zeros so there it is 49 in base 10 is equivalent to:
Some practice can try it:

Two's complement:
Binary numbers are representing a negative integer using a system known as two's complement, this
system of representing a negative number allows computers to perform subtraction operations.
Methods that can be used to convert negative denary numbers into two's complement conversion would
involve a gadget like each bit has a place value and where there's a 1 the corresponding place value is
significant it represents a portion of the complete number this means can convert from binary to denary
by simply adding up the place values wherever there's a 1. An 8-bit binary representation of the number
90 to represent negative numbers.
We can make a very simple change to our conversion gadget from now on the leftmost bit will have a
negative place value with 8 bits this place value is minus 128. Perform the conversion in exactly the same
way as before by adding up the place values wherever there's a 1 but this time, we have minus 128 in
the mix so end up with minus 38 useful.

What's special about this way of representing negative numbers! answer is a mechanism by which
computers can perform subtraction in binary suppose for a moment that want to subtract 38 from 90 in
base 10.

Now let’s take 90 minus 38 is 52 or to put that another way 90 plus negative 38 is 52. Therefore, can be
used the same principle to perform binary subtraction this is 90 in binary and this is negative 38 let's just
add them together.
Then convert the result back into base 10 you can see it's 52 as expected, representation a positive
number using this new system that convert from binary to dinery of negative denary numbers into
binary used same principle and same gadget. for instance, to convert -6 into 8-bit binary. A 1 underneath
the minus 128 place value this for every negative number; and now need to decide what going to add to
in order to reach -6. As shown below.

Another example:

This method provides immediately result without actually doing extensive calculations at all. In other
word we have another example if all bits are 1’s:

The calculations going to biggest positive number fact this positive number is the largest positive number
that can represent using 8 bits with this particular system.
Another example this time we have only 1 underneath of negative place value and all of the others are 0:

We can see immediately what this is going to work out 2 minus 128 this is the most negative number
that we can represent using 8 bits with this particular scheme. Another way that proved all number
represent positive numbers with eight bits available we could represent 256 different base 10 values
ranging (from 0 to 255). In order to represent negative numbers as well with this system we're using half
of the available bit combinations to represent negative numbers it's still 256 values but these values now
minus.
Important notice all of the positive binary numbers begin with 0 and all of the negative binary numbers
begin with 1 using this method of representing binary numbers inform whether a number is positive or
negative at a glance here are some examples you can try:

There is another way to arrive at exactly the same representation for a negative number in which don’t
need a mental arithmetic with. This method much easier in fact this alternative method of conversion
numbers namely two's complement. There's no need to concern yourself with negative place values
now.

But need to apply ones complement of each bit well to make 0 to 1 then add whole number to 1 as
shown in practices below, this method produces the same results:
Fixed Point Binary Fractions:
A real numbers representations that is on integers using fixed point binary. The notation most modern
computers use floating-point binary to represent real numbers. The binary system has a wide range of
applications in real time systems where the speed of calculations is more important than accuracy. Also,
an understanding of fixed-point binary, first is an essential step a processor with a 12-bit registers for
storing binary numbers into register. The first 8 bits could be used to represent whole number portion of
a real number and the last 4 bits could be used to represent the fractional part of the real number in
base 10. Use a decimal point to indicate where the fractional part of a number begins in this register can
use a point stressed that the notional position of this binary poin.t The designers were decided a fixed
position and can't be moved of this particular processor is always represents numbers with 8 bits before
the binary point and 4 bits after. To convert this fixed-point binary number into denary that can be used
a familiar gadget. But this time place values decrease in powers of 2 after the binary point conversion is
as simple as adding up the place values.

Typically, express the value as a decimal fraction. Another example let's convert the headings of these
place values from vulgar fractions into decimal fractions to make these calculations is easier straightaway
because the negative place value has a zero with a decimal friction.

This example of negative number might prefer to use a calculator to work with:
The same processor as before a 12-bit register with eight bits before the binary point and 4-bits after

And these examples from denary to binary:


Consider some special cases:

floating-point binary:
Represent a real number using floating-point binary notation most modern computers use floating-point
binary to represent real numbers; because floating-point binary particularly efficient used computer
registers when it comes to representing either extremely large or small values. The values that require a
high degree of precision floating-point binary is similar to standard scientific notation in base 10.

Some special values in scientific notation you might recognize some of these the speed of light,
Avogadro's called a mole it's the number of molecular weights of a substance and others. These values
are either very large or very small let's take a look at what this notation means.

In all notations have two parts, a mantissa and the exponent to convert into more familiar into decimal
point 23 places the right and then filled with zeroes this number a very large value indeed so many digits
that are occupies a lot of space.

A more accurate value but look at all those zeroes it's still an approximation. In computer science can
present a charge on an electron this time an example of a very small number notice that the exponent is
a negative.
Form clearly this is a very small fraction indeed so how does this apply to the representation of real
numbers in the digital computer.

A 16-bit register inside a processor by design 10-bits on the left have been allocated to the mantissa and
six bits on the right have been allocated to the exponent. The mantissa is stored in two's complement
and so is the exponent an imaginary binary point is located immediately to the right of the sign bit the
sign bit is the leftmost bit in the register.

Floating-point formats are varied from machine to other machine, some put the exponent on the left the
mantas are on the right and some use sign and magnitude instead of two's complement. In most of
today's computers more about the IEEE standard format.

In fact, it means that this 16-bit register contains a positive number if the sign bit of the mantissa was a 1
be looking at a negative number. The exponent is positive because the leftmost bit is 0 and 1 that instead
to a negative exponent.

Let take example to convert number into base 10 first work out the value of the exponent in denary in
this case it's positive 3. In 3 places to the right, as shown in figure below. The conversion gadget arrives
original number in pure binary the result 6.5 in base 10 this final conversion.
A couple more examples, but the mantissa is 4-bits and exponent are 4-bits:

Another example were a positive mantissa and a positive exponent because they both start with zero
first work out the value of exponent in denary which is a positive is float point it two places to the right.
By using conversion gadget into denary.

And on more example at a glance can see it's a positive value because the mantissa is positive but this
time it's a negative exponent in this case minus two so have to have the original mantissa times two to
the power of minus two float the point two places to the left so value in pure binary plug into a gadget to
give the final result.
A couple more examples, but the mantissa is 4-bits and exponent is 4-bits:

A negative number example:


And more examples

You might also like