Chapter 4. Arithmetic for Computers

Size: px
Start display at page:

Download "Chapter 4. Arithmetic for Computers"

Transcription

1 Chapter 4 Arithmetic for Computers Arithmetic Where we've been: Performance (seconds, cycles, instructions) What's up ahead: Implementing the Architecture operation a b ALU 32 result 2

2 Constructing an ALU (Arithmetic Logic Unit) ALU is a device that performs the arithmetic operations like addition and subtraction, or logical operations like AND and OR. An ALU can be constructed from four hardware building blocks: AND gate, OR gate, Inverter, and Multiplexor. (What is the truth table of each?) The Multiplexor: If S == then C = A else C = B Selects one of the inputs to be the output, based on a control input. S A B C 3 ALU (Cont.) Let's build an ALU to support the andi and ori instructions We'll just build a bit ALU, and use 32 of them because MIPS word is 32 bits wide operation op a b res a b result 4

3 The -bit Logical Unit for AND and OR Operation a Result b 5 Different Implementations Not easy to decide the best way to build something Don't want too many inputs to a single gate Don t want to have to go through too many gates for our purposes, ease of comprehension is important Let's look at a -bit ALU for addition: a b CarryOut Sum A full adder or a (3,2) adder has three inputs (a, b, & Cin) and two outputs (Sum & Cout). A half adder or a (2,2) adder has only 2 inputs (a & b) and 2 outputs (Sum & Cout). How could we build a -bit ALU for Add, AND, and OR? How could we build a 32-bit ALU? 6

4 7 Input and Output Specification for -bit Adder Sum CarryOut b a Outputs Inputs 8 Values of the Inputs when CarryOut is a CarryOut = (b. ) + (a. ) + (a. b) + (a. b. ) If a. b. is true, then all of the other terms must be true, so we leave out the last term. c out = a b + a c in + b c in b a Inputs

5 Adder Hardware for the Carry Out Signal a b CarryOut The above Hardware was constructed from the following equation: CarryOut = (b. ) + (a. ) + (a. b) 9 The Sum bit The Sum bit is set to when exactly one input is or when all three inputs are. (check Truth Table on slide 7). Sum = (a. b. ) + (a. b. ) + (a. b. ) + (a. b. ) Sum = a XOR b XOR c in Draw the logic circuit? (Left as exercise).

6 A -bit ALU that Performs AND, OR, & Addition Operation a Result b 2 CarryOut A 32 bit ALU Constructed from 32 -bit ALUs. Ripple carry: CarryOut of the less significant bit is connected to the of the more significant bit. a b a b C a rry In ALU C a rry O u t C a rry In ALU C a rry O u t O p e ra tio n Result Result a2 b2 C a rry In ALU2 C a rry O u t Result2 a3 b3 C a rry In ALU3 Result3 2

7 What about subtraction (a b)? Two's complement approach: just negate b and add. How do we negate? A very clever solution: Binvert Operation a Result b 2 CarryOut 3 Tailoring the ALU to the MIPS Need to support the set-on-less-than instruction (slt) remember: slt is an arithmetic instruction produces a if rs < rt and otherwise use subtraction: (a-b) < implies a < b Need to support test for equality (beq $t5, $t6, $t7) use subtraction: (a-b) = implies a = b 4

8 Detecting Overflow No overflow when adding a positive and a negative number No overflow when signs are the same for subtraction Overflow occurs when the value affects the sign: overflow when adding two positives yields a negative or, adding two negatives gives a positive or, subtract a negative from a positive and get a negative or, subtract a positive from a negative and get a positive 5 Supporting slt (A -bit ALU that performs AND, OR, ) In slt operation, the least significant bit is set either to or, and the rest of the bits (3 bits) are set to. means negative and means positive. So, we need only to connect the sign bit from the adder output to the least significant bit to get set on less than. The result output from the most significant ALU bit for the slt operation is not the output of the adder. So, the ALU output for slt is input value Less a. B in v e r t O p e r a tio n C a r r y I n a b 2 Less 3 C a r r y O u t R e s u lt

9 Supporting slt (A -bit ALU for the most significant bit) We need a new -bit ALU for the most significant bit that has an extra output bit: the adder output. This figure shows the design, with this new adder output line called Set, and used only for slt. As long as we need a special ALU for the most significant bit, we added the overflow detection logic since it is also associated with that bit. a Less Binvert b 2 Overflow detection Operation 3 Result Set Overflow b. 7 A 32-bit ALU constructed from 3 copies of -bit ALU) Binvert Operation a b ALU Less CarryOut Result a b ALU Less CarryOut Result a2 b2 ALU2 Less CarryOut Result2 a3 b3 ALU3 Less Set Result3 Overflow 8

10 Test for equality [ (a b = ) a = b ] The simplest way is to OR all the outputs together and then send that signal through an inverter as shown in the figure. Bnegate a b ALU Less CarryOut Result Operation a b ALU Less CarryOut Result Zero Note: zero is a when the result is zero! When ALU do subtraction, set both and Binvert to. For Adds or logical operations, we want both control lines to be. So, for simplicity combining the and Binvert to a single control line called Bnegate a2 b2 a3 b3 ALU2 Less CarryOut ALU3 Less Result2 Result3 Set Overflow 9 Control Lines We can think of the combination of the -bit Bnegate line and the 2-bit Operation lines as 3-bit control lines for the ALU, telling it to perform add, subtract, AND, OR, or set on less than. Notice control lines: = and = or = add = subtract = slt 2

11 The Symbol Commonly Used to Represent an ALU ALU operation a b ALU Zero result Overflow CarryOut 2 Conclusion We can build an ALU to support the MIPS instruction set key idea: use multiplexor to select the output we want we can efficiently perform subtraction using two s complement we can replicate a -bit ALU to produce a 32-bit ALU Important points about hardware all of the gates are always working the speed of a gate is affected by the number of inputs to the gate the speed of a circuit is affected by the number of gates in series (on the critical path or the deepest level of logic ) Our primary focus: Clever changes to organization can improve performance (similar to using better algorithms in software) we ll look at two examples for addition and multiplication 22

12 Problem: Ripple Carry Adder is Slow Is a 32-bit ALU as fast as a -bit ALU? Is there more than one way to do addition? two extremes: ripple carry and sum-of-products Can you see the ripple? How could you get rid of it? c = b c + a c +a b c 2 = b c + a c +a b c 2 = c 3 = b 2 c 2 + a 2 c 2 +a 2 b 2 c 3 = c 4 = b 3 c 3 + a 3 c 3 +a 3 b 3 c 4 = Not feasible! Why? 23 Carry Lookahead Adder (First Level of Abstraction) An approach in-between our two extremes Ci+ = (bi. ci) + (ai. ci) + (ai.bi) = (ai. bi) + (ai + bi). ci Example: c2=(a.b)+(a+b).((a.b)+(a+b).c) Motivation: If we didn't know the value of carry-in, what could we do? When would we always generate a carry? g i = a i b i When would we propagate the carry? p i = a i + b i Using generate and propagate to define ci+ we get: ci+ = gi + pi. ci Suppose gi equals. Then ci+ = gi + pi. ci = + pi. ci = That is, the adder generates a CarryOut (ci+) independent of the value of (ci) 24

13 Carry Lookahead Adder (Continue) Suppose that gi is and pi is. Then ci+ = gi + pi. ci = +. ci = ci That is, the adder propagates to a CarryOut. So, i+ = if either gi is or both pi= and i=. Example: We express the signals more economically. Let s show it for 4 bits: c= (g+(p.c) c2= g+(p.g)+(p.p.c) c3= g2+(p2.g)+(p2.p.g)+(p2.p.p.c) c4= g3+(p3.g2)+(p3.p2.g)+(p3.p2.p.g)+(p3.p2.p.p.c) Even this simplified form leads to large equations. For example, consider a 6-bit adder. 25 Carry Lookahead Adder (Second Level of Abstraction) To perform carry lookahead adder for 4-bit adders, we need propagate and generate signals at higher level. Example: For four 4-bit adder blocks: P= p3.p2.p.p P= p7.p6.p5.p4 P2= p.p.p9.p8 P3= p5.p4.p3.p2 That is, super propagate signal for the 4-bit abstraction (Pi) is true only if each of the bits in the group will propagate a carry. 26

14 Carry Lookahead Adder (Continue) For the super generate signal (Gi), we care only if there is a carry out of the most significant bit of the 4-bit group. It also occurs if an earlier generate is true and all the intermediate propagates, including that of the most significant bit, are also true: G= g3+(p3.g2)+(p3.p2.g)+(p3.p2.p.g) G= g7+(p7.g6)+(p7.p6.g5)+(p7.p6.p5.g4) G2= g+(p.g)+(p.p.g9)+(p.p.p9.g8) G3= g5+(p5.g4)+(p5.p4.g3)+(p5.p4.p3.g2) 27 Carry Lookahead Adder (Continue) The carry in for each 4-bit group of the 6-bit adder are: C= G + (P.c) C2= G + (P.G) + (P.P.c) C3= G2 + (P2.G) + (P2.P.G) + (P2.P.P.c) C4= G3 + (P3.G2) + (P3.P2.G) + (P3.P2.P.G) + (P3.P2.P.P.c) 28

15 Four 4-bit ALUs using Carry Lookahead to form a 6-bit adder C a r r y I n a b a b a 2 b 2 a 3 b 3 C a r r y I n A L U P G C p i g i c i + R e s u l t C a r r y - l o o k a h e a d u n i t a 4 b 4 a 5 b 5 a 6 b 6 a 7 b 7 C a r r y I n A L U P G C 2 p i + g i + c i + 2 R e s u l t a 8 b 8 a 9 b 9 a b a b C a r r y I n A L U 2 P 2 G 2 C 3 p i + 2 g i + 2 c i + 3 R e s u l t a 2 b 2 a 3 b 3 a 4 b 4 a 5 b 5 C a r r y I n A L U 3 P 3 G 3 C 4 p i + 3 g i + 3 c i + 4 R e s u l t C a r r y O u t 29 Example: Both Levels of the Propagate and Generate Determine the gi, pi, Pi, and Gi values of these two 6- bit numbers: a: two b: two Also, what is CarryOut 5 (C4)? Answer: Aligning the bits makes it easy to see the values of generate gi (ai. bi) and propagate pi (ai + bi): a: b: gi: pi: where the bits are numbered 5 to from left to right. 3

16 Answer (Continue) Next, the super propagates (P3, P2, P, P) are simply the AND of the lower-level propagates: P3 =... = P2 =... = P =... = P =... = The super generates are more complex, so use the following equations: G = g3 +(p3.g2)+(p3.p2.g)+(p3.p2.p.g) = +(.)+(..)+(...)= G = g7 +(p7.g6)+(p7.p6.g5)+(p7.p6.p5.g4) = +(.)+(..)+(...)= G2 = g +(p.g)+(p.p.g9)+(p.p.p9.g8) = +(.)+(..)+(...)= G3 = g5 +(p5.g4)+(p5.p4.g3)+(p5.p4.p3.g2) = +(.)+(..)+(...)= 3 Answer (Continue) Finally, CarryOut 5 is C4 = G3 +(P3.G2)+(P3.P2.G)+(P3.P2.P.G) +(P3.P2.P.P.c) = +(.)+(..)+(...)+(...)= Hence there is a carry out when adding these two 6-bit numbers. 32

17 Example: Speed of Ripple Carry versus Carry Lookahead Assume each AND or OR gate takes the same time for a signal to pass through it. Time is estimated by simply counting the number of gates along the longest path through a piece of logic. Compare the number of gate delays for the critical paths of two 6-bit adders, one using ripple carry and one using two-level carry lookahead. 33 Answer a b CarryOut The above figure shows that the carry out signal takes two gates delays per bit. Then the number of gate delays between a carry in to the least significant bit and the carry out to the most significant is 6 x 2 =

18 Answer (Continue) For carry lookahead, the carry out of the most significant bit is just C4, defined in the previous example (Slide 32). It takes two level of logic to specify C4 in terms of Pi and Gi (the OR of several AND terms). Pi is specified in one level of logic (AND) using pi. Gi is specified in two levels using pi and gi. pi and gi are each one level of logic, defined in terms of ai and bi. If we assume one gate delay for each level of logic in these equations, the worst case is = 5 gate delays. Hence for 6-bit addition a carry-lookahead adder is six times faster, using this simple estimate of hardware speed. 35 Multiplication More complicated than addition accomplished via shifting and addition More time and more area Let's look at 3 versions based on grade school algorithm (multiplicand) x_ (multiplier) (Product) If we ignore the sign bits, the length of the multiplication of an n-bit multiplicand and an m-bit multiplier is a product that is n + m bits long. That is, n + m bits are required to represent all possible products. 36

19 Multiplication Each step of multiplication is simple:. Just place a copy of the multiplicand ( x multiplicand) in the proper place if the multiplier digit is, or 2. Place ( x multiplicand) in the proper place if the digit is. Negative numbers: convert and multiply there are better techniques, we won t look at them. 37 First Version of the Multiplication Hardware Multiplicand 64 bits Shift left 64-bit ALU Multiplier Shift right 32 bits Product 64 bits Write Control test 38

20 First Version of the Multiplication Hardware The Multiplicand register, ALU, and Product register are all 64 bits wide, with only the Multiplier register containing 32 bits. We will need to move the multiplicand left one digit each step as it may be added to the intermediate products. So, over 32 steps a 32-bit multiplicand would move 32 bits to the left. Hence we need a 64-bit Multiplicand register, initialized with the 32-bit multiplication in the right half and in the left half. The multiplier is shifted in the opposite direction at each step. The Product register initialized to. Control decides when to shift the Multiplicand and Multiplier registers and when to write new values into the Product register. 39 The First Multiplication Algorithm Using Hardware in Slide 38 S t a r t M u lt ip lie r =. T e s t M u lt ip lie r M u lt ip lie r = a. A d d m u lt ip lic a n d t o p r o d u c t a n d place the result in P roduct register 2. S hift the M ultiplicand register left bit 3. S hift the M ultiplier register right bit 3 2 n d r e p e t itio n? N o : < 3 2 r e p e tit io n s Y e s : 3 2 r e p e titio n s D o n e 4

21 The First Multiplication Algorithm If the least significant bit of the multiplier is, add the multiplicand to the product. If not, go to the next step. Shift the multiplicand left and the multiplier right in the next two steps. These three steps are repeated 32 times. 4 Example: First Multiply Algorithm Using 4-bit numbers to save space, multiply x. Iteration Step Initial Values Multiplier Multiplicand Product a: Prod =Prod + Mcand 2: Shift left Multiplicand 3: Shift right Multiplier 2 a: Prod =Prod + Mcand 2: Shift left Multiplicand 3: Shift right Multiplier 3 : no operation 2: Shift left Multiplicand 4 3: Shift right Multiplier : no operation 2: Shift left Multiplicand 3: Shift right Multiplier 42

22 Example: First Multiply Algorithm The table (slide 42) shows the value of each register for each of the steps labeled according to the algorithm (slide 4), with the final value of (6 in decimal). Color is used to indicate the register values that change on that step. The underline bit is the one examined to determine the operation of the next step. If each step took a clock cycle, this algorithm would require 32 x 3 steps = 96 clock cycles to multiply two 32-bit numbers. 43 Second Version of the Multiplication Algorithm and Hardware Half of the bits of the multiplicand in the first algorithm were always, so only half could contain useful bit values. A full 64-bit ALU seemed wasteful and slow since half of the adder bits were adding to the intermediate sum. The first algorithm shifts the multiplicand left with s inserted in the new positions, so the multiplicand cannot affect the least significant bits of the product. Instead of shifting the multiplicand left, what if we shift the product right? Now the multiplicand would be fixed relative to the product, and since we are adding only 32 bits, the adder need be only 32 bits wide. 44

23 Second Version of the Multiplication Hardware Multiplicand 32 bits 32-bit ALU Multiplier Shift right 32 bits Product 64 bits Shift right Write Control test 45 Second Version of the Multiplication Hardware Compare with the first version in slide 38. The Multiplicand register, ALU, and Multiplier register are all 32 bits wide with only the Product register left at 64 bits. Now the product is shifted right. 46

24 Second Multiplication Algorithm Using the Hardware in Slide 45 S t a r t M u ltip lie r =. T e s t M u ltip lie r M u ltip lie r = a. A d d m u lt ip lic a n d t o t h e le ft h a lf o f the product and place the result in th e le ft h a lf o f th e P ro d u c t re g iste r 2. S h if t t h e Product register right b it 3. S hift the M ultiplier register right bit 3 2 n d r e p e t itio n? N o : < 3 2 re p e titio n s Y e s : 3 2 r e p e t itio n s D o n e 47 Second Multiplication Algorithm This algorithm starts with the 32-bit Multiplicand and 32-bit Multiplier registers set to their named values and the 64-bit Product register set to. The Product register is shifted right instead of shifting the multiplicand. This algorithm only forms a 32-bit sum, so only the left half of the 64-bit Product register is changed by the addition. 48

25 Example: Second Multiply Algorithm Multiply x using the algorithm in slide 47. Iteration Step Initial Values Multiplier Multiplicand Product a: Prod =Prod + Mcand 3: Shift right Multiplier 2 a: Prod =Prod + Mcand 3: Shift right Multiplier 3 : no operation 4 3: Shift right Multiplier : no operation 3: Shift right Multiplier 49 Final Version of the Multiplication Algorithm and Hardware The final observation was that the Product register had wasted space that matched exactly the size of the multiplier. The third version of the multiplication algorithm combines the right-most half of the product with the multiplier. The least significant bit of the 64-bit Product register (Product) now is the bit to be tested. 5

26 Third Version of the Multiplication Hardware Multiplicand 32 bits 32-bit ALU Product 64 bits Shift right Write Control test 5 Third Version of the Multiplication Hardware Comparing with the second version in slide 45. The separate Multiplier register has disappeared. The multiplier is placed instead in the right half of the Product register. 52

27 The Third Multiplication Algorithm S t a r t P r o d u c t =. T e s t P r o d u c t P r o d u c t = a. A d d m u ltip lic a n d t o t h e le ft h a lf o f th e p ro d u c t a n d p la c e th e re s u lt in th e le ft h a lf o f th e P r o d u c t r e g is t e r 2. S h if t th e P r o d u c t r e g is te r r ig h t b it 3 2 n d r e p e titio n? N o : < 3 2 r e p e titio n s Y e s : 3 2 re p e titio n s D o n e 53 The Third Multiplication Algorithm The algorithm starts by assigning the multiplier to the right half of the Product register, placing in the upper half. It needs only two steps because the Product and Multiplier registers have been combined. 54

28 Example: Third Multiply Algorithm Multiply x using the algorithm in slide 53. Iteration Initial Values Step Multiplicand Product a: Prod =Prod + Mcand 2 3 a: Prod =Prod + Mcand : no operation 4 : no operation 55 Signed Multiplication So far we have dealt with positive numbers. Signed numbers: First convert the Multiplier and Multiplicand to positive numbers and then remember the original signs. The algorithm runs for 3 iterations, leaving the signs out of the calculations. We need to negate the product only if the original signs disagree. 56

29 Booth s Algorithm Booth s algorithm changes the first step of the third multiplication algorithm in slide 53 looking at bit of the multiplier and then deciding whether to add the multiplicand to looking at 2 bits of the multiplier. The new first step has four cases, depending on the values of the 2 bits (check next slide). Assume that the pair of bits examined consists of the current bit and the bit to the right which has the current bit in the previous step. The second step is to shift the product right. 57 Booth s Algorithm The value of these 2 bits: Current bit Bit to the right Explanation Example Beginning of a run of s Middle of a run of s End of a run of s Middle of a run of s 58

30 Booth s Algorithm Booth s Algorithm steps:. Depending on the current and previous bits, do one of the following: : Middle of a string of s, so no arithmetic operation. : End of a string of s, so add the multiplicand to the left half of the product. : Beginning of a string of s, so subtract the multiplicand from the left half of the product. : Middle of a string of s, so no arithmetic operation. 2. As in the previous algorithm (version three), shift the Product register right bit. 59 Comparing Third Algorithm and Booth s Algorithm for Positive Numbers Multilicand Iteration Original Algorithm Step Product Booth s Algorithm Step Product Initial values Initial values : no operation a: no operation 2 a: Prod = Prod + Mcand c: Prod = Prod Mcand 3 a: Prod = Prod + Mcand d: no operation 4 : no operation b: Prod = Prod + Mcand 6

31 Comparing Example (Continue) Booth s algorithm starts with a to the right of the rightmost bit for the first stage. Booth s operation is identified according to the values in the 2 bits. By the fourth step, the two algorithms have the same values in the Product register. The one other requirement is that shifting the product right must preserve the sign of the intermediate result, since we are dealing with signed numbers. The solution is to extend the sign when the product is shifted to the right. Example: Step 2 of the second iteration turns into instead of. This shift is called an arithmetic right shift to differentiate it from a logical right shift. 6 Example: Booth s Algorithm Let s try Booth s algorithm with negative numbers: 2 x 3 = -6 or x = (in binary). Iteration Step Multiplicand Product Initial values c: Prod = Prod Mcand 2 b: Prod = Prod + Mcand 3 c: Prod = Prod Mcand 4 d: no operation 62

32 Multiply in MIPS MIPS provides a separate pair of 32-bit registers to contain the 64-bit product, called Hi and Lo. To produce a properly signed or unsigned product, MIPS has two instructions: multiply (mult) and multiply unsigned (multu). 63 Chapter Four Summary Constructing an ALU to do the following arithmetic and logical operations: AND, OR, addition, subtraction, less than, and equality. Ripple Adder versus Carry-Lookahead. Three versions of Multiplications. Signed Multiplication Booth s Algorithm. We are ready to move on (and implement the processor). 64

Lecture 8: Binary Multiplication & Division

Lecture 8: Binary Multiplication & Division Lecture 8: Binary Multiplication & Division Today s topics: Addition/Subtraction Multiplication Division Reminder: get started early on assignment 3 1 2 s Complement Signed Numbers two = 0 ten 0001 two

More information

Binary Adders: Half Adders and Full Adders

Binary Adders: Half Adders and Full Adders Binary Adders: Half Adders and Full Adders In this set of slides, we present the two basic types of adders: 1. Half adders, and 2. Full adders. Each type of adder functions to add two binary bits. In order

More information

CSE140 Homework #7 - Solution

CSE140 Homework #7 - Solution CSE140 Spring2013 CSE140 Homework #7 - Solution You must SHOW ALL STEPS for obtaining the solution. Reporting the correct answer, without showing the work performed at each step will result in getting

More information

Digital Logic Design. Basics Combinational Circuits Sequential Circuits. Pu-Jen Cheng

Digital Logic Design. Basics Combinational Circuits Sequential Circuits. Pu-Jen Cheng Digital Logic Design Basics Combinational Circuits Sequential Circuits Pu-Jen Cheng Adapted from the slides prepared by S. Dandamudi for the book, Fundamentals of Computer Organization and Design. Introduction

More information

Let s put together a Manual Processor

Let s put together a Manual Processor Lecture 14 Let s put together a Manual Processor Hardware Lecture 14 Slide 1 The processor Inside every computer there is at least one processor which can take an instruction, some operands and produce

More information

Binary Division. Decimal Division. Hardware for Binary Division. Simple 16-bit Divider Circuit

Binary Division. Decimal Division. Hardware for Binary Division. Simple 16-bit Divider Circuit Decimal Division Remember 4th grade long division? 43 // quotient 12 521 // divisor dividend -480 41-36 5 // remainder Shift divisor left (multiply by 10) until MSB lines up with dividend s Repeat until

More information

Implementation of Modified Booth Algorithm (Radix 4) and its Comparison with Booth Algorithm (Radix-2)

Implementation of Modified Booth Algorithm (Radix 4) and its Comparison with Booth Algorithm (Radix-2) Advance in Electronic and Electric Engineering. ISSN 2231-1297, Volume 3, Number 6 (2013), pp. 683-690 Research India Publications http://www.ripublication.com/aeee.htm Implementation of Modified Booth

More information

Sistemas Digitais I LESI - 2º ano

Sistemas Digitais I LESI - 2º ano Sistemas Digitais I LESI - 2º ano Lesson 6 - Combinational Design Practices Prof. João Miguel Fernandes (miguel@di.uminho.pt) Dept. Informática UNIVERSIDADE DO MINHO ESCOLA DE ENGENHARIA - PLDs (1) - The

More information

Chapter 4 Register Transfer and Microoperations. Section 4.1 Register Transfer Language

Chapter 4 Register Transfer and Microoperations. Section 4.1 Register Transfer Language Chapter 4 Register Transfer and Microoperations Section 4.1 Register Transfer Language Digital systems are composed of modules that are constructed from digital components, such as registers, decoders,

More information

Adder.PPT(10/1/2009) 5.1. Lecture 13. Adder Circuits

Adder.PPT(10/1/2009) 5.1. Lecture 13. Adder Circuits Adder.T(//29) 5. Lecture 3 Adder ircuits Objectives Understand how to add both signed and unsigned numbers Appreciate how the delay of an adder circuit depends on the data values that are being added together

More information

A single register, called the accumulator, stores the. operand before the operation, and stores the result. Add y # add y from memory to the acc

A single register, called the accumulator, stores the. operand before the operation, and stores the result. Add y # add y from memory to the acc Other architectures Example. Accumulator-based machines A single register, called the accumulator, stores the operand before the operation, and stores the result after the operation. Load x # into acc

More information

EE 261 Introduction to Logic Circuits. Module #2 Number Systems

EE 261 Introduction to Logic Circuits. Module #2 Number Systems EE 261 Introduction to Logic Circuits Module #2 Number Systems Topics A. Number System Formation B. Base Conversions C. Binary Arithmetic D. Signed Numbers E. Signed Arithmetic F. Binary Codes Textbook

More information

NEW adder cells are useful for designing larger circuits despite increase in transistor count by four per cell.

NEW adder cells are useful for designing larger circuits despite increase in transistor count by four per cell. CHAPTER 4 THE ADDER The adder is one of the most critical components of a processor, as it is used in the Arithmetic Logic Unit (ALU), in the floating-point unit and for address generation in case of cache

More information

This Unit: Floating Point Arithmetic. CIS 371 Computer Organization and Design. Readings. Floating Point (FP) Numbers

This Unit: Floating Point Arithmetic. CIS 371 Computer Organization and Design. Readings. Floating Point (FP) Numbers This Unit: Floating Point Arithmetic CIS 371 Computer Organization and Design Unit 7: Floating Point App App App System software Mem CPU I/O Formats Precision and range IEEE 754 standard Operations Addition

More information

DEPARTMENT OF INFORMATION TECHNLOGY

DEPARTMENT OF INFORMATION TECHNLOGY DRONACHARYA GROUP OF INSTITUTIONS, GREATER NOIDA Affiliated to Mahamaya Technical University, Noida Approved by AICTE DEPARTMENT OF INFORMATION TECHNLOGY Lab Manual for Computer Organization Lab ECS-453

More information

Computer Science 281 Binary and Hexadecimal Review

Computer Science 281 Binary and Hexadecimal Review Computer Science 281 Binary and Hexadecimal Review 1 The Binary Number System Computers store everything, both instructions and data, by using many, many transistors, each of which can be in one of two

More information

To convert an arbitrary power of 2 into its English equivalent, remember the rules of exponential arithmetic:

To convert an arbitrary power of 2 into its English equivalent, remember the rules of exponential arithmetic: Binary Numbers In computer science we deal almost exclusively with binary numbers. it will be very helpful to memorize some binary constants and their decimal and English equivalents. By English equivalents

More information

Lecture 2. Binary and Hexadecimal Numbers

Lecture 2. Binary and Hexadecimal Numbers Lecture 2 Binary and Hexadecimal Numbers Purpose: Review binary and hexadecimal number representations Convert directly from one base to another base Review addition and subtraction in binary representations

More information

Binary full adder. 2-bit ripple-carry adder. CSE 370 Spring 2006 Introduction to Digital Design Lecture 12: Adders

Binary full adder. 2-bit ripple-carry adder. CSE 370 Spring 2006 Introduction to Digital Design Lecture 12: Adders SE 370 Spring 2006 Introduction to Digital Design Lecture 12: dders Last Lecture Ls and Ls Today dders inary full 1-bit full omputes sum, carry-out arry-in allows cascaded s = xor xor = + + 32 ND2 11 ND2

More information

COMP 303 MIPS Processor Design Project 4: MIPS Processor Due Date: 11 December 2009 23:59

COMP 303 MIPS Processor Design Project 4: MIPS Processor Due Date: 11 December 2009 23:59 COMP 303 MIPS Processor Design Project 4: MIPS Processor Due Date: 11 December 2009 23:59 Overview: In the first projects for COMP 303, you will design and implement a subset of the MIPS32 architecture

More information

CHAPTER 3 Boolean Algebra and Digital Logic

CHAPTER 3 Boolean Algebra and Digital Logic CHAPTER 3 Boolean Algebra and Digital Logic 3.1 Introduction 121 3.2 Boolean Algebra 122 3.2.1 Boolean Expressions 123 3.2.2 Boolean Identities 124 3.2.3 Simplification of Boolean Expressions 126 3.2.4

More information

exclusive-or and Binary Adder R eouven Elbaz reouven@uwaterloo.ca Office room: DC3576

exclusive-or and Binary Adder R eouven Elbaz reouven@uwaterloo.ca Office room: DC3576 exclusive-or and Binary Adder R eouven Elbaz reouven@uwaterloo.ca Office room: DC3576 Outline exclusive OR gate (XOR) Definition Properties Examples of Applications Odd Function Parity Generation and Checking

More information

(Refer Slide Time: 00:01:16 min)

(Refer Slide Time: 00:01:16 min) Digital Computer Organization Prof. P. K. Biswas Department of Electronic & Electrical Communication Engineering Indian Institute of Technology, Kharagpur Lecture No. # 04 CPU Design: Tirning & Control

More information

The string of digits 101101 in the binary number system represents the quantity

The string of digits 101101 in the binary number system represents the quantity Data Representation Section 3.1 Data Types Registers contain either data or control information Control information is a bit or group of bits used to specify the sequence of command signals needed for

More information

FORDHAM UNIVERSITY CISC 3593. Dept. of Computer and Info. Science Spring, 2011. The Binary Adder

FORDHAM UNIVERSITY CISC 3593. Dept. of Computer and Info. Science Spring, 2011. The Binary Adder FORDHAM UNIVERITY CIC 3593 Fordham College Lincoln Center Computer Organization Dept. of Computer and Info. cience pring, 2011 1 Introduction The Binar Adder The binar adder circuit is an important building

More information

Divide: Paper & Pencil. Computer Architecture ALU Design : Division and Floating Point. Divide algorithm. DIVIDE HARDWARE Version 1

Divide: Paper & Pencil. Computer Architecture ALU Design : Division and Floating Point. Divide algorithm. DIVIDE HARDWARE Version 1 Divide: Paper & Pencil Computer Architecture ALU Design : Division and Floating Point 1001 Quotient Divisor 1000 1001010 Dividend 1000 10 101 1010 1000 10 (or Modulo result) See how big a number can be

More information

Flip-Flops, Registers, Counters, and a Simple Processor

Flip-Flops, Registers, Counters, and a Simple Processor June 8, 22 5:56 vra235_ch7 Sheet number Page number 349 black chapter 7 Flip-Flops, Registers, Counters, and a Simple Processor 7. Ng f3, h7 h6 349 June 8, 22 5:56 vra235_ch7 Sheet number 2 Page number

More information

ECE410 Design Project Spring 2008 Design and Characterization of a CMOS 8-bit Microprocessor Data Path

ECE410 Design Project Spring 2008 Design and Characterization of a CMOS 8-bit Microprocessor Data Path ECE410 Design Project Spring 2008 Design and Characterization of a CMOS 8-bit Microprocessor Data Path Project Summary This project involves the schematic and layout design of an 8-bit microprocessor data

More information

CS201: Architecture and Assembly Language

CS201: Architecture and Assembly Language CS201: Architecture and Assembly Language Lecture Three Brendan Burns CS201: Lecture Three p.1/27 Arithmetic for computers Previously we saw how we could represent unsigned numbers in binary and how binary

More information

earlier in the semester: The Full adder above adds two bits and the output is at the end. So if we do this eight times, we would have an 8-bit adder.

earlier in the semester: The Full adder above adds two bits and the output is at the end. So if we do this eight times, we would have an 8-bit adder. The circuit created is an 8-bit adder. The 8-bit adder adds two 8-bit binary inputs and the result is produced in the output. In order to create a Full 8-bit adder, I could use eight Full -bit adders and

More information

Counters and Decoders

Counters and Decoders Physics 3330 Experiment #10 Fall 1999 Purpose Counters and Decoders In this experiment, you will design and construct a 4-bit ripple-through decade counter with a decimal read-out display. Such a counter

More information

Lab 1: Full Adder 0.0

Lab 1: Full Adder 0.0 Lab 1: Full Adder 0.0 Introduction In this lab you will design a simple digital circuit called a full adder. You will then use logic gates to draw a schematic for the circuit. Finally, you will verify

More information

COMBINATIONAL CIRCUITS

COMBINATIONAL CIRCUITS COMBINATIONAL CIRCUITS http://www.tutorialspoint.com/computer_logical_organization/combinational_circuits.htm Copyright tutorialspoint.com Combinational circuit is a circuit in which we combine the different

More information

1. Convert the following base 10 numbers into 8-bit 2 s complement notation 0, -1, -12

1. Convert the following base 10 numbers into 8-bit 2 s complement notation 0, -1, -12 C5 Solutions 1. Convert the following base 10 numbers into 8-bit 2 s complement notation 0, -1, -12 To Compute 0 0 = 00000000 To Compute 1 Step 1. Convert 1 to binary 00000001 Step 2. Flip the bits 11111110

More information

VHDL Test Bench Tutorial

VHDL Test Bench Tutorial University of Pennsylvania Department of Electrical and Systems Engineering ESE171 - Digital Design Laboratory VHDL Test Bench Tutorial Purpose The goal of this tutorial is to demonstrate how to automate

More information

5 Combinatorial Components. 5.0 Full adder. Full subtractor

5 Combinatorial Components. 5.0 Full adder. Full subtractor 5 Combatorial Components Use for data transformation, manipulation, terconnection, and for control: arithmetic operations - addition, subtraction, multiplication and division. logic operations - AND, OR,

More information

6 3 4 9 = 6 10 + 3 10 + 4 10 + 9 10

6 3 4 9 = 6 10 + 3 10 + 4 10 + 9 10 Lesson The Binary Number System. Why Binary? The number system that you are familiar with, that you use every day, is the decimal number system, also commonly referred to as the base- system. When you

More information

COMP 250 Fall 2012 lecture 2 binary representations Sept. 11, 2012

COMP 250 Fall 2012 lecture 2 binary representations Sept. 11, 2012 Binary numbers The reason humans represent numbers using decimal (the ten digits from 0,1,... 9) is that we have ten fingers. There is no other reason than that. There is nothing special otherwise about

More information

Understanding Logic Design

Understanding Logic Design Understanding Logic Design ppendix of your Textbook does not have the needed background information. This document supplements it. When you write add DD R0, R1, R2, you imagine something like this: R1

More information

CS 61C: Great Ideas in Computer Architecture Finite State Machines. Machine Interpreta4on

CS 61C: Great Ideas in Computer Architecture Finite State Machines. Machine Interpreta4on CS 61C: Great Ideas in Computer Architecture Finite State Machines Instructors: Krste Asanovic & Vladimir Stojanovic hbp://inst.eecs.berkeley.edu/~cs61c/sp15 1 Levels of RepresentaKon/ InterpretaKon High

More information

Instruction Set Design

Instruction Set Design Instruction Set Design Instruction Set Architecture: to what purpose? ISA provides the level of abstraction between the software and the hardware One of the most important abstraction in CS It s narrow,

More information

United States Naval Academy Electrical and Computer Engineering Department. EC262 Exam 1

United States Naval Academy Electrical and Computer Engineering Department. EC262 Exam 1 United States Naval Academy Electrical and Computer Engineering Department EC262 Exam 29 September 2. Do a page check now. You should have pages (cover & questions). 2. Read all problems in their entirety.

More information

A New Paradigm for Synchronous State Machine Design in Verilog

A New Paradigm for Synchronous State Machine Design in Verilog A New Paradigm for Synchronous State Machine Design in Verilog Randy Nuss Copyright 1999 Idea Consulting Introduction Synchronous State Machines are one of the most common building blocks in modern digital

More information

Binary Representation. Number Systems. Base 10, Base 2, Base 16. Positional Notation. Conversion of Any Base to Decimal.

Binary Representation. Number Systems. Base 10, Base 2, Base 16. Positional Notation. Conversion of Any Base to Decimal. Binary Representation The basis of all digital data is binary representation. Binary - means two 1, 0 True, False Hot, Cold On, Off We must be able to handle more than just values for real world problems

More information

Counters are sequential circuits which "count" through a specific state sequence.

Counters are sequential circuits which count through a specific state sequence. Counters Counters are sequential circuits which "count" through a specific state sequence. They can count up, count down, or count through other fixed sequences. Two distinct types are in common usage:

More information

1. True or False? A voltage level in the range 0 to 2 volts is interpreted as a binary 1.

1. True or False? A voltage level in the range 0 to 2 volts is interpreted as a binary 1. File: chap04, Chapter 04 1. True or False? A voltage level in the range 0 to 2 volts is interpreted as a binary 1. 2. True or False? A gate is a device that accepts a single input signal and produces one

More information

LFSR BASED COUNTERS AVINASH AJANE, B.E. A technical report submitted to the Graduate School. in partial fulfillment of the requirements

LFSR BASED COUNTERS AVINASH AJANE, B.E. A technical report submitted to the Graduate School. in partial fulfillment of the requirements LFSR BASED COUNTERS BY AVINASH AJANE, B.E A technical report submitted to the Graduate School in partial fulfillment of the requirements for the degree Master of Science in Electrical Engineering New Mexico

More information

Step : Create Dependency Graph for Data Path Step b: 8-way Addition? So, the data operations are: 8 multiplications one 8-way addition Balanced binary

Step : Create Dependency Graph for Data Path Step b: 8-way Addition? So, the data operations are: 8 multiplications one 8-way addition Balanced binary RTL Design RTL Overview Gate-level design is now rare! design automation is necessary to manage the complexity of modern circuits only library designers use gates automated RTL synthesis is now almost

More information

Instruction Set Architecture. or How to talk to computers if you aren t in Star Trek

Instruction Set Architecture. or How to talk to computers if you aren t in Star Trek Instruction Set Architecture or How to talk to computers if you aren t in Star Trek The Instruction Set Architecture Application Compiler Instr. Set Proc. Operating System I/O system Instruction Set Architecture

More information

Systems I: Computer Organization and Architecture

Systems I: Computer Organization and Architecture Systems I: omputer Organization and Architecture Lecture 8: Registers and ounters Registers A register is a group of flip-flops. Each flip-flop stores one bit of data; n flip-flops are required to store

More information

3.Basic Gate Combinations

3.Basic Gate Combinations 3.Basic Gate Combinations 3.1 TTL NAND Gate In logic circuits transistors play the role of switches. For those in the TTL gate the conducting state (on) occurs when the baseemmiter signal is high, and

More information

Today. Binary addition Representing negative numbers. Andrew H. Fagg: Embedded Real- Time Systems: Binary Arithmetic

Today. Binary addition Representing negative numbers. Andrew H. Fagg: Embedded Real- Time Systems: Binary Arithmetic Today Binary addition Representing negative numbers 2 Binary Addition Consider the following binary numbers: 0 0 1 0 0 1 1 0 0 0 1 0 1 0 1 1 How do we add these numbers? 3 Binary Addition 0 0 1 0 0 1 1

More information

An Efficient RNS to Binary Converter Using the Moduli Set {2n + 1, 2n, 2n 1}

An Efficient RNS to Binary Converter Using the Moduli Set {2n + 1, 2n, 2n 1} An Efficient RNS to Binary Converter Using the oduli Set {n + 1, n, n 1} Kazeem Alagbe Gbolagade 1,, ember, IEEE and Sorin Dan Cotofana 1, Senior ember IEEE, 1. Computer Engineering Laboratory, Delft University

More information

BOOLEAN ALGEBRA & LOGIC GATES

BOOLEAN ALGEBRA & LOGIC GATES BOOLEAN ALGEBRA & LOGIC GATES Logic gates are electronic circuits that can be used to implement the most elementary logic expressions, also known as Boolean expressions. The logic gate is the most basic

More information

Oct: 50 8 = 6 (r = 2) 6 8 = 0 (r = 6) Writing the remainders in reverse order we get: (50) 10 = (62) 8

Oct: 50 8 = 6 (r = 2) 6 8 = 0 (r = 6) Writing the remainders in reverse order we get: (50) 10 = (62) 8 ECE Department Summer LECTURE #5: Number Systems EEL : Digital Logic and Computer Systems Based on lecture notes by Dr. Eric M. Schwartz Decimal Number System: -Our standard number system is base, also

More information

Session 7 Fractions and Decimals

Session 7 Fractions and Decimals Key Terms in This Session Session 7 Fractions and Decimals Previously Introduced prime number rational numbers New in This Session period repeating decimal terminating decimal Introduction In this session,

More information

BINARY CODED DECIMAL: B.C.D.

BINARY CODED DECIMAL: B.C.D. BINARY CODED DECIMAL: B.C.D. ANOTHER METHOD TO REPRESENT DECIMAL NUMBERS USEFUL BECAUSE MANY DIGITAL DEVICES PROCESS + DISPLAY NUMBERS IN TENS IN BCD EACH NUMBER IS DEFINED BY A BINARY CODE OF 4 BITS.

More information

Asynchronous counters, except for the first block, work independently from a system clock.

Asynchronous counters, except for the first block, work independently from a system clock. Counters Some digital circuits are designed for the purpose of counting and this is when counters become useful. Counters are made with flip-flops, they can be asynchronous or synchronous and they can

More information

Combinational Logic Design

Combinational Logic Design Chapter 4 Combinational Logic Design The foundations for the design of digital logic circuits were established in the preceding chapters. The elements of Boolean algebra (two-element switching algebra

More information

CSE140: Components and Design Techniques for Digital Systems

CSE140: Components and Design Techniques for Digital Systems CSE4: Components and Design Techniques for Digital Systems Tajana Simunic Rosing What we covered thus far: Number representations Logic gates Boolean algebra Introduction to CMOS HW#2 due, HW#3 assigned

More information

Gates, Circuits, and Boolean Algebra

Gates, Circuits, and Boolean Algebra Gates, Circuits, and Boolean Algebra Computers and Electricity A gate is a device that performs a basic operation on electrical signals Gates are combined into circuits to perform more complicated tasks

More information

Module 3: Floyd, Digital Fundamental

Module 3: Floyd, Digital Fundamental Module 3: Lecturer : Yongsheng Gao Room : Tech - 3.25 Email : yongsheng.gao@griffith.edu.au Structure : 6 lectures 1 Tutorial Assessment: 1 Laboratory (5%) 1 Test (20%) Textbook : Floyd, Digital Fundamental

More information

Figure 8-1 Four Possible Results of Adding Two Bits

Figure 8-1 Four Possible Results of Adding Two Bits CHPTER EIGHT Combinational Logic pplications Thus far, our discussion has focused on the theoretical design issues of computer systems. We have not yet addressed any of the actual hardware you might find

More information

Pre-Algebra Lecture 6

Pre-Algebra Lecture 6 Pre-Algebra Lecture 6 Today we will discuss Decimals and Percentages. Outline: 1. Decimals 2. Ordering Decimals 3. Rounding Decimals 4. Adding and subtracting Decimals 5. Multiplying and Dividing Decimals

More information

CDA 3200 Digital Systems. Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012

CDA 3200 Digital Systems. Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012 CDA 3200 Digital Systems Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012 Outline Data Representation Binary Codes Why 6-3-1-1 and Excess-3? Data Representation (1/2) Each numbering

More information

Computer organization

Computer organization Computer organization Computer design an application of digital logic design procedures Computer = processing unit + memory system Processing unit = control + datapath Control = finite state machine inputs

More information

Chapter 4: Computer Codes

Chapter 4: Computer Codes Slide 1/30 Learning Objectives In this chapter you will learn about: Computer data Computer codes: representation of data in binary Most commonly used computer codes Collating sequence 36 Slide 2/30 Data

More information

Chapter 2 Logic Gates and Introduction to Computer Architecture

Chapter 2 Logic Gates and Introduction to Computer Architecture Chapter 2 Logic Gates and Introduction to Computer Architecture 2.1 Introduction The basic components of an Integrated Circuit (IC) is logic gates which made of transistors, in digital system there are

More information

RN-coding of Numbers: New Insights and Some Applications

RN-coding of Numbers: New Insights and Some Applications RN-coding of Numbers: New Insights and Some Applications Peter Kornerup Dept. of Mathematics and Computer Science SDU, Odense, Denmark & Jean-Michel Muller LIP/Arénaire (CRNS-ENS Lyon-INRIA-UCBL) Lyon,

More information

FORDHAM UNIVERSITY CISC 3593. Dept. of Computer and Info. Science Spring, 2011. Lab 2. The Full-Adder

FORDHAM UNIVERSITY CISC 3593. Dept. of Computer and Info. Science Spring, 2011. Lab 2. The Full-Adder FORDHAM UNIVERSITY CISC 3593 Fordham College Lincoln Center Computer Organization Dept. of Computer and Info. Science Spring, 2011 Lab 2 The Full-Adder 1 Introduction In this lab, the student will construct

More information

Levent EREN levent.eren@ieu.edu.tr A-306 Office Phone:488-9882 INTRODUCTION TO DIGITAL LOGIC

Levent EREN levent.eren@ieu.edu.tr A-306 Office Phone:488-9882 INTRODUCTION TO DIGITAL LOGIC Levent EREN levent.eren@ieu.edu.tr A-306 Office Phone:488-9882 1 Number Systems Representation Positive radix, positional number systems A number with radix r is represented by a string of digits: A n

More information

RN-Codings: New Insights and Some Applications

RN-Codings: New Insights and Some Applications RN-Codings: New Insights and Some Applications Abstract During any composite computation there is a constant need for rounding intermediate results before they can participate in further processing. Recently

More information

Positional Numbering System

Positional Numbering System APPENDIX B Positional Numbering System A positional numbering system uses a set of symbols. The value that each symbol represents, however, depends on its face value and its place value, the value associated

More information

CMOS Binary Full Adder

CMOS Binary Full Adder CMOS Binary Full Adder A Survey of Possible Implementations Group : Eren Turgay Aaron Daniels Michael Bacelieri William Berry - - Table of Contents Key Terminology...- - Introduction...- 3 - Design Architectures...-

More information

Digital Electronics Detailed Outline

Digital Electronics Detailed Outline Digital Electronics Detailed Outline Unit 1: Fundamentals of Analog and Digital Electronics (32 Total Days) Lesson 1.1: Foundations and the Board Game Counter (9 days) 1. Safety is an important concept

More information

MACHINE INSTRUCTIONS AND PROGRAMS

MACHINE INSTRUCTIONS AND PROGRAMS CHAPTER 2 MACHINE INSTRUCTIONS AND PROGRAMS CHAPTER OBJECTIVES In this chapter you will learn about: Machine instructions and program execution, including branching and subroutine call and return operations

More information

Two's Complement Adder/Subtractor Lab L03

Two's Complement Adder/Subtractor Lab L03 Two's Complement Adder/Subtractor Lab L03 Introduction Computers are usually designed to perform indirect subtraction instead of direct subtraction. Adding -B to A is equivalent to subtracting B from A,

More information

Lecture 5: Gate Logic Logic Optimization

Lecture 5: Gate Logic Logic Optimization Lecture 5: Gate Logic Logic Optimization MAH, AEN EE271 Lecture 5 1 Overview Reading McCluskey, Logic Design Principles- or any text in boolean algebra Introduction We could design at the level of irsim

More information

plc numbers - 13.1 Encoded values; BCD and ASCII Error detection; parity, gray code and checksums

plc numbers - 13.1 Encoded values; BCD and ASCII Error detection; parity, gray code and checksums plc numbers - 3. Topics: Number bases; binary, octal, decimal, hexadecimal Binary calculations; s compliments, addition, subtraction and Boolean operations Encoded values; BCD and ASCII Error detection;

More information

150127-Microprocessor & Assembly Language

150127-Microprocessor & Assembly Language Chapter 3 Z80 Microprocessor Architecture The Z 80 is one of the most talented 8 bit microprocessors, and many microprocessor-based systems are designed around the Z80. The Z80 microprocessor needs an

More information

Addressing The problem. When & Where do we encounter Data? The concept of addressing data' in computations. The implications for our machine design(s)

Addressing The problem. When & Where do we encounter Data? The concept of addressing data' in computations. The implications for our machine design(s) Addressing The problem Objectives:- When & Where do we encounter Data? The concept of addressing data' in computations The implications for our machine design(s) Introducing the stack-machine concept Slide

More information

Part 1 Expressions, Equations, and Inequalities: Simplifying and Solving

Part 1 Expressions, Equations, and Inequalities: Simplifying and Solving Section 7 Algebraic Manipulations and Solving Part 1 Expressions, Equations, and Inequalities: Simplifying and Solving Before launching into the mathematics, let s take a moment to talk about the words

More information

CS101 Lecture 26: Low Level Programming. John Magee 30 July 2013 Some material copyright Jones and Bartlett. Overview/Questions

CS101 Lecture 26: Low Level Programming. John Magee 30 July 2013 Some material copyright Jones and Bartlett. Overview/Questions CS101 Lecture 26: Low Level Programming John Magee 30 July 2013 Some material copyright Jones and Bartlett 1 Overview/Questions What did we do last time? How can we control the computer s circuits? How

More information

Zuse's Z3 Square Root Algorithm Talk given at Fall meeting of the Ohio Section of the MAA October 1999 - College of Wooster

Zuse's Z3 Square Root Algorithm Talk given at Fall meeting of the Ohio Section of the MAA October 1999 - College of Wooster Zuse's Z3 Square Root Algorithm Talk given at Fall meeting of the Ohio Section of the MAA October 1999 - College of Wooster Abstract Brian J. Shelburne Dept of Math and Comp Sci Wittenberg University In

More information

Reduced Instruction Set Computer (RISC)

Reduced Instruction Set Computer (RISC) Reduced Instruction Set Computer (RISC) Focuses on reducing the number and complexity of instructions of the ISA. RISC Goals RISC: Simplify ISA Simplify CPU Design Better CPU Performance Motivated by simplifying

More information

Circuits and Boolean Expressions

Circuits and Boolean Expressions Circuits and Boolean Expressions Provided by TryEngineering - Lesson Focus Boolean logic is essential to understanding computer architecture. It is also useful in program construction and Artificial Intelligence.

More information

Chapter 5 Instructor's Manual

Chapter 5 Instructor's Manual The Essentials of Computer Organization and Architecture Linda Null and Julia Lobur Jones and Bartlett Publishers, 2003 Chapter 5 Instructor's Manual Chapter Objectives Chapter 5, A Closer Look at Instruction

More information

Multiplying and Dividing Signed Numbers. Finding the Product of Two Signed Numbers. (a) (3)( 4) ( 4) ( 4) ( 4) 12 (b) (4)( 5) ( 5) ( 5) ( 5) ( 5) 20

Multiplying and Dividing Signed Numbers. Finding the Product of Two Signed Numbers. (a) (3)( 4) ( 4) ( 4) ( 4) 12 (b) (4)( 5) ( 5) ( 5) ( 5) ( 5) 20 SECTION.4 Multiplying and Dividing Signed Numbers.4 OBJECTIVES 1. Multiply signed numbers 2. Use the commutative property of multiplication 3. Use the associative property of multiplication 4. Divide signed

More information

Lecture 12: More on Registers, Multiplexers, Decoders, Comparators and Wot- Nots

Lecture 12: More on Registers, Multiplexers, Decoders, Comparators and Wot- Nots Lecture 12: More on Registers, Multiplexers, Decoders, Comparators and Wot- Nots Registers As you probably know (if you don t then you should consider changing your course), data processing is usually

More information

Systems I: Computer Organization and Architecture

Systems I: Computer Organization and Architecture Systems I: Computer Organization and Architecture Lecture 9 - Register Transfer and Microoperations Microoperations Digital systems are modular in nature, with modules containing registers, decoders, arithmetic

More information

Karnaugh Maps & Combinational Logic Design. ECE 152A Winter 2012

Karnaugh Maps & Combinational Logic Design. ECE 152A Winter 2012 Karnaugh Maps & Combinational Logic Design ECE 52A Winter 22 Reading Assignment Brown and Vranesic 4 Optimized Implementation of Logic Functions 4. Karnaugh Map 4.2 Strategy for Minimization 4.2. Terminology

More information

Multipliers. Introduction

Multipliers. Introduction Multipliers Introduction Multipliers play an important role in today s digital signal processing and various other applications. With advances in technology, many researchers have tried and are trying

More information

Introducción. Diseño de sistemas digitales.1

Introducción. Diseño de sistemas digitales.1 Introducción Adapted from: Mary Jane Irwin ( www.cse.psu.edu/~mji ) www.cse.psu.edu/~cg431 [Original from Computer Organization and Design, Patterson & Hennessy, 2005, UCB] Diseño de sistemas digitales.1

More information

Tom wants to find two real numbers, a and b, that have a sum of 10 and have a product of 10. He makes this table.

Tom wants to find two real numbers, a and b, that have a sum of 10 and have a product of 10. He makes this table. Sum and Product This problem gives you the chance to: use arithmetic and algebra to represent and analyze a mathematical situation solve a quadratic equation by trial and improvement Tom wants to find

More information

Welcome to Basic Math Skills!

Welcome to Basic Math Skills! Basic Math Skills Welcome to Basic Math Skills! Most students find the math sections to be the most difficult. Basic Math Skills was designed to give you a refresher on the basics of math. There are lots

More information

Take-Home Exercise. z y x. Erik Jonsson School of Engineering and Computer Science. The University of Texas at Dallas

Take-Home Exercise. z y x. Erik Jonsson School of Engineering and Computer Science. The University of Texas at Dallas Take-Home Exercise Assume you want the counter below to count mod-6 backward. That is, it would count 0-5-4-3-2-1-0, etc. Assume it is reset on startup, and design the wiring to make the counter count

More information

Systems I: Computer Organization and Architecture

Systems I: Computer Organization and Architecture Systems I: Computer Organization and Architecture Lecture 2: Number Systems and Arithmetic Number Systems - Base The number system that we use is base : 734 = + 7 + 3 + 4 = x + 7x + 3x + 4x = x 3 + 7x

More information

Systems I: Computer Organization and Architecture

Systems I: Computer Organization and Architecture Systems I: Computer Organization and Architecture Lecture : Microprogrammed Control Microprogramming The control unit is responsible for initiating the sequence of microoperations that comprise instructions.

More information

Dr Brian Beaudrie pg. 1

Dr Brian Beaudrie pg. 1 Multiplication of Decimals Name: Multiplication of a decimal by a whole number can be represented by the repeated addition model. For example, 3 0.14 means add 0.14 three times, regroup, and simplify,

More information