O U T L I N E
6.1Digital Arithmetic
6.2Representing Signed Binary Numbers
6.3Signed Binary Arithmetic
6.4Hexadecimal Arithmetic
6.5Numeric and Alphanumeric Codes
6.6Binary Adders and Subtractors
6.7BCD Adders
6.8Carry Generation in MAX PLUS II
C H A P T E R O B J E C T I V E S
Upon successful completion of this chapter, you will be able to:
•Add or subtract two unsigned binary numbers.
•Write a signed binary number in true-magnitude, 1’s complement, or 2’s complement form.
•Add or subtract two signed binary numbers.
•Explain the concept of overflow.
•Calculate the maximum sum or difference of two signed binary numbers that will not result in an overflow.
•Add or subtract two hexadecimal numbers.
•Write decimal numbers in BCD codes, such as 8421 (Natural BCD) and Excess-3 code.
•Construct a Gray code sequence.
•Use the ASCII table to convert alphanumeric characters to hexadecimal or binary numbers and vice versa.
•Derive the logic gate circuits for full and half adders, given their truth tables.
•Demonstrate the use of full and half adder circuits in arithmetic and other applications.
•Add and subtract n-bit binary numbers, using parallel binary adders and logic gates.
•Explain the difference between ripple carry and parallel carry.
•Design a circuit to detect sign-bit overflow in a parallel adder.
•Draw circuits to perform BCD arithmetic and explain their operation.
•Use VHDL to program CPLD devices to perform various arithmetic functions, such as parallel adders, overflow detectors, and 1’s complementers.
There are two ways of performing binary arithmetic: with unsigned binary numbers or with signed binary numbers. Signed binary numbers incorporate a bit defining the sign of a number; unsigned binary numbers do not. Several ways of writing signed binary num-
bers are true-magnitude form, which maintains the magnitude of the number in binary value, and 1’s complement and 2’s complement forms, which modify the magnitude but are more suited to digital circuitry.