Question: Please solve each part Problem 2. (10 points) In this problem we explore the use of logic in computer arithmetic. As you know, computers represent
Problem 2. (10 points) In this problem we explore the use of logic in computer arithmetic. As you know, computers represent numbers using the bits (binary digits) 0 and 1. These bits represent (obviously!) the numbers zero and one respectively. The number two is represented as 10, three is 11, and four is 100. The four bit sequence bab2b,bo represents the number 2%, + 21b1 + 22b2 + 23b3. As examples, the sequence 1001 represents (23 x 1) + (21x 1) = 8 + 1 = 9, while the number thirteen is represented as 1101. Suppose we have to design an addition circuit to add three one-bit numbers ag,bo,Co. The possible values for the sum are 0, 1, 2, and 3. So the sum will be represented by a 2-bit number S1So. For example, 0+1+1 = 10, while 1+0+0-01. To see the connection to logic, let us correspond the bit value 1 with the logical value T (True) and 0 with F (False). So we can consider ao, bo, Co,S1, So to be logical variables. Construct the truth tables for s1 and so in terms of the inputs ao,bo,Co- For example, when ao-T, bo-T, co = F, the truth values of s1 = T and so-F. Express So as a proposition using the variables ao, bo,Co and the logical connectives a. b. Av. write a similar expression for si. c. Express so and s1 using only the NAND connective discussed in lecture. d. Next, let's see how to add two 2-bit numbers a,ao, bi,bo to produce the 3-bit result s2s1So. Recall how we usually add numbers- we first add the lowest order bits (ao and bo) to get the value so as well as a "carry bit" which when added with a and b produces s, and a carry bit (which is s2 for 2-bit numbers). Express each of s2, St, So in terms of a1, ao.b, bo using the NAND connective
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
