Digital Electronics and Design with VHDL

Chapter 3: Binary Arithmetic

Overview

Objective: Humans are used to doing arithmetic operations with decimal numbers, while computers perform similar arithmetic operations but use the binary system of 0 s and 1 s. The objective of this chapter is to show how the latter occurs. The analysis includes unsigned and signed values, of both integer and real-valued types. Because shift operations can also implement certain arithmetic functions, they too are included in this chapter.

Chapter Contents

3.1

Unsigned Addition

3.2

Signed Addition and Subtraction

3.3

Shift Operations

3.4

Unsigned Multiplication

3.5

Signed Multiplication

3.6

Unsigned Division

3.7

Signed Division

3.8

Floating-Point Addition and Subtraction

3.9

Floating-Point Multiplication

3.10

Floating-Point Division

3.11

Exercises

3.1 Unsigned Addition

Binary addition (also called modulo-2 addition) was introduced in Section 2.5, with Figure 2.5 repeated in Figure 3.1 below. The vectors within the gray area are given, while the others must be calculated. a = a 3 a 2 a 1 a 0 and b = b 3 b 2 b 1 b 0 represent 4-bit numbers to be added, producing a 5-bit sum vector, sum = s 4 s 3 s 2 s 1 s 0, and a 4-bit carry vector, carry = c 4 c 3 c 2 c 1. The algorithm is summarized in (b) (recall that it is a modulo-2 operation). In (c), an example is given in which "1100" (= 12) is added to "0110" (= 6), producing "10010" (= 18)...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Arithmetic Logic Units (ALU)
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.