# Fixed point arithmetic  (Page 2/4)

 Page 2 / 4

For example, we interpret an 8-bit binary word ${b}_{7}{b}_{6}{b}_{5}{b}_{4}{b}_{3}{b}_{2}{b}_{1}{b}_{0}$ as an integer $x=-({b}_{7}2^{7})+{b}_{6}2^{6}++{b}_{1}\times 2+{b}_{0}=-({b}_{7}2^{7})+\sum_{i=0}^{6} 2^{i}{b}_{i}$ in the 2's complement representation, and $x$ ranges from $-128$ ( $-2^{7}$ ) to $127$ ( $2^{7}-1$ ). Several examples:

binary decimal
00000000 0
00000001 1
01000000 64
01111111 127
10000000 -128
10000001 -127
11000000 -64
11111111 -1

When $x$ is a positive (negative) number in 2's complement format, $-x$ can be found by inverting each bit and adding $1$ . For example, $01000000$ is $64$ in decimal and $-64$ is found by first inverting the bits to obtain $10111111$ and adding $1$ , thus $-64$ is $11000000$ as shown in the above table. Because the MSB indicates the sign of the numberrepresented by the binary word, we call this bit the sign bit . If the sign bit is 0, the word represents positive number, while negative numbers have 1as the sign bit.

In 2's compliment representation, subtraction of two integers can be accomplished by usual binary summation bycomputing $x-y$ as $x+-y$ . We investigate the operations on the 2's compliment numbers later . However, when you add two 2's complement numbers, you must keep in mind that the 1 inMSB is actually -1.

(2's complement): What are the decimal numbers corresponding to the 2's complement 8-bit binarynumbers; $01001101$ , $11100100$ , $01111001$ , and $10001011$ ?

Intentionally left blank.

Sometimes, you need to convert an 8-bit 2's complement number to a 16-bit number. What is the 16-bit 2's complementnumber representing the same value as the 8-bit numbers $01001011$ and $10010111$ ? The answer is $0000000001001000$ and $1111111110010111$ . For nonnegative numbers (sign bit = 0), you simply addenough 0's to extend the number of bits. For negative numbers, you add enough 1's. This operation is called sign extension . The same rule holds for extending a 16-bit 2's complement number to a 32-bit number.

For the arithmetic assembly instructions, C62x CPU has different versions depending on how it handles the signs.For example, the load instructions LDH and LDB load halfword and byte value to a 32-bit register with sign extension. That is, the loadedvalues are converted to 32-bit 2's complement number and loaded into a register. The instructions LDHU and LDBU do not perform sign extension. They simply fill zeros for theupper 16- and 24-bits, respectively.

For the shift right instructions SHR and SHRU , the same rule applies. The ADDU instruction simply treats the operands as unsigned values.

## Fractional representation

Although using 2's compliment integers we can implement both addition and subtraction by usual binary addition (withspecial care for the sign bit), the integers are not convenient to handle to implement DSP algorithms. Forexample, If we multiply two 8-bit words together, we need 16 bits to store the result. The number of required wordlength increases without bound as we multiply numbers together more. Although not impossible, it is complicatedto handle this increase in word-length using integer arithmetic. The problem can be easily handled by usingnumbers between $-1$ and $1$ , instead of integers, because the product of two numbers in $\left[-1 , 1\right]$ are always in the same range.

#### Questions & Answers

what is the stm
is there industrial application of fullrenes. What is the method to prepare fullrene on large scale.?
Rafiq
industrial application...? mmm I think on the medical side as drug carrier, but you should go deeper on your research, I may be wrong
Damian
How we are making nano material?
what is a peer
What is meant by 'nano scale'?
What is STMs full form?
LITNING
scanning tunneling microscope
Sahil
how nano science is used for hydrophobicity
Santosh
Do u think that Graphene and Fullrene fiber can be used to make Air Plane body structure the lightest and strongest. Rafiq
Rafiq
what is differents between GO and RGO?
Mahi
what is simplest way to understand the applications of nano robots used to detect the cancer affected cell of human body.? How this robot is carried to required site of body cell.? what will be the carrier material and how can be detected that correct delivery of drug is done Rafiq
Rafiq
what is Nano technology ?
write examples of Nano molecule?
Bob
The nanotechnology is as new science, to scale nanometric
brayan
nanotechnology is the study, desing, synthesis, manipulation and application of materials and functional systems through control of matter at nanoscale
Damian
Is there any normative that regulates the use of silver nanoparticles?
what king of growth are you checking .?
Renato
What fields keep nano created devices from performing or assimulating ? Magnetic fields ? Are do they assimilate ?
why we need to study biomolecules, molecular biology in nanotechnology?
?
Kyle
yes I'm doing my masters in nanotechnology, we are being studying all these domains as well..
why?
what school?
Kyle
biomolecules are e building blocks of every organics and inorganic materials.
Joe
anyone know any internet site where one can find nanotechnology papers?
research.net
kanaga
sciencedirect big data base
Ernesto
Introduction about quantum dots in nanotechnology
what does nano mean?
nano basically means 10^(-9). nanometer is a unit to measure length.
Bharti
do you think it's worthwhile in the long term to study the effects and possibilities of nanotechnology on viral treatment?
absolutely yes
Daniel
how to know photocatalytic properties of tio2 nanoparticles...what to do now
it is a goid question and i want to know the answer as well
Maciej
characteristics of micro business
Abigail
for teaching engĺish at school how nano technology help us
Anassong
How can I make nanorobot?
Lily
Do somebody tell me a best nano engineering book for beginners?
there is no specific books for beginners but there is book called principle of nanotechnology
NANO
how can I make nanorobot?
Lily
what is fullerene does it is used to make bukky balls
are you nano engineer ?
s.
fullerene is a bucky ball aka Carbon 60 molecule. It was name by the architect Fuller. He design the geodesic dome. it resembles a soccer ball.
Tarell
what is the actual application of fullerenes nowadays?
Damian
That is a great question Damian. best way to answer that question is to Google it. there are hundreds of applications for buck minister fullerenes, from medical to aerospace. you can also find plenty of research papers that will give you great detail on the potential applications of fullerenes.
Tarell
how did you get the value of 2000N.What calculations are needed to arrive at it
Privacy Information Security Software Version 1.1a
Good
where are the solutions?
where are the solutions?