# 2.2 Module 3: computer arithmetic  (Page 3/3)

 Page 3 / 3

So: -(-128) = -128.

Because 128 is out of the range of signed 8bits numbers.

Addition and Subtraction is done using following steps:

• Monitor sign bit for overflow
• Take twos compliment of subtrahend and add to minuend ,i.e. a - b = a + (-b)

## 3.3 multiplying positive numbers:

The multiplying is done using following steps:

• Work out partial product for each digit
• Take care with place value (column)

## Solution 1:

• Convert to positive if required
• Multiply as above
• If signs were different, negate answer

## Solution 2:

• Booth’s algorithm:

Example of Booth’s Algorithm:

## 3.5 division:

• More complex than multiplication
• Negative numbers are really bad!
• Based on long division
• (for more detail, reference to Computer Organization and Architecture, William Stalling)

## 4.1 principles

We can represent a real number in the form

$±S×{B}^{±E}$

This number can be stored in a binary word with three fields:

• Sign: plus or minus
• Significant: S
• Exponent: E.

(A fixed value, called the bias, is subtracted from the biased exponent field to get the true exponent value (E). Typically, the bias equal ${2}^{k-1}-1$ , where k is the number of bits in the binary exponent)

• The base B is implicit and need not be stored because it is the same for all numbers.

## 4.2 ieee standard for binary floating-point representation

The most important floating-point representation is defined in IEEE Standard 754 [EEE8]. This standard was developed to facilitate the portability of programs from one processor to another and to encourage the development of sophisticated, numerically oriented programs. The standard has been widely adopted and is used on virtually all contemporary processors and arithmetic coprocessors.

The IEEE standard defines both a 32-bit (Single-precision) and a 64-bit (Double-precision) double format with 8-bit and 11-bit exponents, respectively. Binary floating-point numbers are stored in a form where the MSB is the sign bit, exponent is the biased exponent, and "fraction" is the significand. The implied base (B) is 2.

Not all bit patterns in the IEEE formats are interpreted in die usual way; instead, some bit patterns are used to represent special values. Three special cases arise:

1. if exponent is 0 and fraction is 0, the number is ±0 (depending on the sign bit)
2. if exponent = ${2}^{e}$ -1 and fraction is 0, the number is ±infinity (again depending on the sign bit), and
3. if exponent = ${2}^{e}$ -1 and fraction is not 0, the number being represented is not a number (NaN).

This can be summarized as:

Single-precision 32 bit

A single-precision binary floating-point number is stored in 32 bits.

The number has value v:

v = s × ${2}^{e}$ × m

Where

s = +1 (positive numbers) when the sign bit is 0

s = −1 (negative numbers) when the sign bit is 1

e = Exp − 127 (in other words the exponent is stored with 127 added to it, also called "biased with 127")

m = 1.fraction in binary (that is, the significand is the binary number 1 followed by the radix point followed by the binary bits of the fraction). Therefore, 1 ≤ m<2.

In the example shown above:

S=1

E= 011111100(2) -127 = -3

M=1.01 (in binary, which is 1.25 in decimal).

The represented number is: +1.25 × 2−3 = +0.15625.

## 5. floating-point arithmetic

The basic operations for floating-point $\mathrm{X1}=\mathrm{M1}\ast {R}^{\mathrm{E1}}$ and $\mathrm{X2}=\mathrm{M2}\ast {R}^{\mathrm{E2}}$

• $\mathrm{X1}±\mathrm{X2}=\left(\mathrm{M1}\ast {R}^{\mathrm{E1}-\mathrm{E2}}\right){R}^{\mathrm{E2}}$ (assume E1  E2)
• $\mathrm{X1}\ast \mathrm{X2}=\left(\mathrm{M1}\ast \mathrm{M2}\right){R}^{\mathrm{E1}+\mathrm{E2}}$
• $\mathrm{X1}/\mathrm{X2}=\left(\mathrm{M1}/\mathrm{M2}\right){R}^{\mathrm{E1}-\mathrm{E2}}$

For addi­tion and subtraction, it is necessary lo ensure that both operands have the same exponent value. I his may require shifting the radix point on one of the operands to achieve alignment. Multiplication and division are more straightforward.

A floating-point operation may produce one of these conditions:

• Exponent overflow: A positive exponent exceeds the maximum possible expo­nent value. In some systems, this may be designated as
• Exponent underflow: A negative exponent is less than the minimum possible exponent value (e.g.. -200 is less than -127). This means that the number is too small to be represented, and it may be reported as 0.
• Significand underflow: In the process of aligning significands, digits may flow off the right end of the significand. Some form of rounding is required.
• Significand overflow: The addition of two significands of the same sign may result in a carry out of the most significant bit. This can be fixed by realign­ment.

what is application of humanistic theory of classroom
The humanistic learning theory developed further and harnesses the idea that if students are upset, sad, or distressed, they're less likely to be able to focus on learning. This encourages teachers to create a classroom
Dhwani
state the brief history of psychology
James
The history of psychology as a scholarly study of the mind and behavior dates back to the Ancient Greeks. ... Psychology as a self-conscious field of experimental study began in 1879, in Leipzig Germany, when Wilhelm Wundt founded the first laboratory dedicated exclusively to psychological research
Dhwani
can anyone explain sleep and it's stages?
yes
Dhwani
Shachi
sleep works in three hour stages. falling asleep rem, waking back up. do you have a spicific question?
Nathaniel
When thinking about getting the sleep you need, it’s normal to focus on how many hours of sleep you get. While sleep duration is undoubtedly important, it’s not the only part of the equation. It’s also critical to think about sleep quality and whether the time spent sleeping is actually restorative
Dhwani
sleep studies have proven that how you aproach your sleep sycle is important. people will constantly concern thwmselves with how much sleep instead of the quality of sleep they are getting. it is better to get 3 houts of sleepless rest then it is to get 6 of strained sleep
Nathaniel
I mean stages of sleep
Shachi
and it's explaination
Shachi
How brain power can be used to control physical things?
can anyone explain sleep and it's stages?
Shachi
what is the role of psychology in the development of therapies for disorders of a circadian rhythm?
what is the role of psychology in the development of therapies for disorders of circadian rhythm?
wazir
To study Abnormal Psychology means, to study mainly the nature of
abnormal psychology? can you explain please?
la
abnormal, this branch of psychology typically deals with behavior in a clinical context.
pakki
yo
To study Abnormal Psychology means, to study mainly the nature of 1). Conscious Mind 2). Unconscious Mind 3). Subconscious Mind 4). Normal Mind
pakki
yo
Kylee
abnormal psychology- is the scientific study of Psychological disorders and their treatments
utkarsh
Utkarsh Verma can you help me pass out my exams? tomorrom
10 - 11 MCQ test can you all or some help? the only subject I'm weak in is psychology
which branch of psychology is the test on?
pakki
How Abnormal Behavior is Defined While it may seem that the definition of “abnormal” indicates a behavior that is considered outside of the human norm, it is actually a much slipperier slope. Therefore, abnormal psychology takes on the task of scientifically studying and classifying human behaviors
Anye
Yo
Monica
What is the role of psychology in the development of therapies for circadian rhythm disorders?
wazir
please I wish to find out how difficult/easy it is, for someone with a bachelor degree in philosophy to continue with masters and doctoral in psychology, specifically, I-O psychology.
Anye
do the individuals know that they are being researched on? and why does anyone speak up regarding the matter? is it "don't ask, don't tell" policy?
examine any 5 perceptual principals of organization
Is it possible for a child to be schizophrenic?
yes. early onset of schizophrenia starts at 13 to 18. very rare but possible.
Kristel
Good question
Mulder
It's uncommon for children to be diagnosed with schizophrenia.
pakki
what is the role of psychology in the development of therapies for circadian rhythm disorders?
wazir
is there a difference between age and romantic attachment style?
I don't think so. Well, not always. Certain things should be timeless.
Know
I'm 48 & he's 26 ...so we shall see?
Tanya
in my opinion if you both are comfortable with each other then definitely age is nothing but a number but then also there will be little difference in the cognition due to age
utkarsh
yes Utkarsh.I agree with you.We call it as generation gap. But there can be exceptions also...
Shailaja
yes generation gap can affect the relationship but this totally depends on the couple that how they settle up with each other
utkarsh
that is true, balance is needed. I spent a long time with an older man and I was more his child than his partner. power struggles are hard in relationships with generational gaps
Ashley
I think all it all depends on your comfort or braveness and attitude toward life, then age is just numbers.
Sujeet
new perspective n ones mindset towards life plays an important role... if the change is for gud.. go-ahead
Smitha
Yes romantic attachment styles change with age if that's what you are asking. here is where you can read more about it ***google.com/amp/s/qz.com/1206940/attachment-style-changes-with-age/amp/
krish
can empirical research be performed on people being diagnosed or people who have borderline personality disorder?
yes it can
Angela
***pubmed.ncbi.nlm.nih.gov/3711874/
Angela
thank you for the feedback
Stepphun
👍
Angela
yes?
Stepphun
discuss the three models of positional coding in working memory citing examples.Please help me with points to this question
can you clear me up a doubt that for to become a psychriatist what process are needed
What are the vocational choices for women in pakistan also discuss its aims and objectives.
I want to research on Egocentrism and Autistic thinking on myself.
I want to research on Egocentrism and Autistic thinking on myself. Have you any suggestion for me?
RAVI
I want to research on Egocentrism and Autistic thinking on myself. Have you any suggestion for me?
RAVI
why do you think they correlate?
James
what is the role of psychology in the development of therapies for circadian rhythm?
wazir
what is Egocentrism
Ishfaq
External goal that have the capacity to motivate behaviour
Reinforcements and Punishments
Khyzar
indeed! but positive punishment if I may add
Angela
hi. i am a student of B.A. Psychology (major), i wanted to enquire as to which textbook would be most informative on 'Biopsychology' ?
Bhargavi
Hey, I'm currently a BS Psychology major and I'd like to recommend the 10th Edition Biological Psychology book by Kalat
Ayessa
thanks, it really means a lot😀
Bhargavi
You're welcome.
Ayessa
what is logical atomism
Koshivani
When we have data register and address registers in user mode (visible registers) then why we need MAR and MBR
with the given example MOV BX,AX describe the sequence that will be followed using instruction state diagram