• Binary addition • Representing negative numbers, Exams of Number Theory

One oddity: we can represent one more negative number than we can positive numbers Page 42 Andrew H. Fagg: Embedded Real- Time Systems: Binary Arithmetic 55 ...

Typology: Exams

2022/2023

Uploaded on 03/01/2023

arlie
arlie 🇺🇸

4.6

(18)

245 documents

1 / 43

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Andrew H. Fagg: Embedded Real-
Time Systems: Binary Arithmetic 2
Today
Binary addition
Representing negative numbers
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b

Partial preview of the text

Download • Binary addition • Representing negative numbers and more Exams Number Theory in PDF only on Docsity!

Andrew H. Fagg: Embedded Real-Time Systems: Binary Arithmetic

Today

  • Binary addition• Representing negative numbers

Andrew H. Fagg: Embedded Real-Time Systems: Binary Arithmetic

Binary Addition

Consider the following binary numbers:

How do we add these numbers?

Andrew H. Fagg: Embedded Real-Time Systems: Binary Arithmetic

Binary Addition

And we have a carry now!

Andrew H. Fagg: Embedded Real-Time Systems: Binary Arithmetic

Binary Addition

0 0 1And we have a carry again!

Andrew H. Fagg: Embedded Real-Time Systems: Binary Arithmetic

Binary Addition

Andrew H. Fagg: Embedded Real-Time Systems: Binary Arithmetic

Binary Addition

One more carry!

Andrew H. Fagg: Embedded Real-Time Systems: Binary Arithmetic

Binary Addition

Behaves just like addition in decimal, but:• We carry to the next digit any time the sum

of the digits is 2 (decimal) or greater

Andrew H. Fagg: Embedded Real-Time Systems: Binary Arithmetic

Negative Numbers

So far we have only talked about

representing non-negative integers

  • What can we add to our binary

representation that will allow this?

Andrew H. Fagg: Embedded Real-Time Systems: Binary Arithmetic

Sign Magnitude Representation+

Andrew H. Fagg: Embedded Real-Time Systems: Binary Arithmetic

Sign Magnitude Representation+

Andrew H. Fagg: Embedded Real-Time Systems: Binary Arithmetic

Sign Magnitude RepresentationWhat is the problem with this approach?• Some of the arithmetic operators that we

have already developed do not do the rightthing

Andrew H. Fagg: Embedded Real-Time Systems: Binary Arithmetic

Sign Magnitude RepresentationOperator problems:• For example, we have already designed a

counter (that implements an ‘increment’operation)

Andrew H. Fagg: Embedded Real-Time Systems: Binary Arithmetic

Sign Magnitude RepresentationOperator problems:-

Increment

Andrew H. Fagg: Embedded Real-Time Systems: Binary Arithmetic

Sign Magnitude RepresentationOperator problems:-

Increment