Download presentation
Presentation is loading. Please wait.
Published byCecilia Sherilyn Lyons Modified over 9 years ago
1
Arithmetic Operations and Circuits Lecture 5
2
Binary Arithmetic let’s look at the procedures for performing the four basic arithmetic functions: addition, subtraction, multiplication, and division Addition The procedure for adding numbers in binary is similar to adding in decimal, except that the binary sum is made up of only 1’s and 0’s. When the binary sum exceeds 1, you must carry a 1 to the next-more-significant column, as in regular decimal addition
3
Addition
4
Subtraction
6
Multiplication
8
Division
9
Two’s-Complement Representation To be able to represent both positive and negative numbers, the two’s-complement format uses the most significant bit (MSB) of the 8- or 16-bit number to signify whether the number is positive or negative The MSB is therefore called the sign bit and is defined as 0 for positive numbers and 1 for negative numbers The range of positive numbers in an 8-bit system is 0000 0000 to 0111 1111 (0 to 127). The range of negative numbers is 1111 1111 to 1000 0000 ( -1 to -128)
11
Two’s-Complement Representation
13
Two’s-Complement Arithmetic All four of the basic arithmetic functions involving positive and negative numbers can be dealt with very simply using two’s-complement arithmetic Subtraction is done by adding the two two’s-complement numbers
14
Two’s-Complement Arithmetic
15
Hexadecimal Arithmetic A method of representing groups of 4 bits as a single digit. Hexadecimal notation has been widely adopted by manufacturers of computers and microprocessors because it simplifies the documentation and use of their equipment.
17
Hexadecimal Arithmetic Subtraction of hexadecimal numbers is similar to decimal subtraction, except that when you borrow 1 from the left, the borrower increases in value by 16
18
BCD Arithmetic Digital electronics naturally works in binary, and we have to group four binary digits together to get enough combinations to represent the 10 different decimal digits. This 4- bit code is called binary-coded decimal (BCD).
20
Arithmetic Circuits All the arithmetic operations and procedures can be implemented using adders formed from the basic logic gates. For a large number of digits we can use medium-scale-integration (MSI) circuits, which actually have several adders within a single integrated package Basic Adder Circuit (a)Addition of two 2-bit binary numbers; (b)truth table for the LSB addition; (c) truth table for the more significant column
21
Half-Adder Full-Adder
23
Block Diagrams We can simplify HA and FA representation by just drawing a box with the input and output lines Block diagram of a 4-bit binary adder.
24
Four-Bit Full-Adder ICs
25
Two’s-Complement Adder/Subtractor Circuit
27
Arithmetic/Logic Units Arithmetic/logic units (ALUs) are available in large-scale IC packages (LSI). The LSI circuits are generally considered to be ICs containing from 100 to 10,000 gate equivalents. Typically, an ALU is a multipurpose device capable of providing several different arithmetic and logic operations. The specific operation to be performed is chosen by theuser by placing a specific binary code on the mode select inputs. Microprocessors mayalso have ALUs built in as one of their many operational units. In such cases, the specific operation to be performed is chosen by software instructions. Once the mode control (M) is set, you have 16 choices within either the logic or arithmetic categories. The specific function you want is selected by applying the appropriate binary code to the function select inputs (S3 to S0)
28
Arithmetic/Logic Units
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.