|
| 1 | +\model{Multi-Byte Numbers} |
| 2 | + |
| 3 | + {\it\large Refer to Model 3 above as your team develops consensus answers |
| 4 | + to the questions below.} |
| 5 | + |
| 6 | + \quest{20 min} |
| 7 | + |
| 8 | + \Q Consider the expression with two unsigned integers: (1100 0001$_2$ + 0100 0011$_2$). |
| 9 | + \begin{itemize} |
| 10 | + \item What is the binary sum? |
| 11 | + \hfill\ans{1 0000 0100} |
| 12 | + \item How many bits are required for the answer? |
| 13 | + \hfill\ans{9} |
| 14 | + \end{itemize} |
| 15 | + |
| 16 | + \Q Consider the 8-Bit Adder shown in Figure 4. |
| 17 | + \vspace{10pt} |
| 18 | + \begin{center} |
| 19 | + \includegraphics[width=0.3\textwidth]{figures/8bit_adder.png} |
| 20 | + \par\vspace{5pt} |
| 21 | + {\small Figure 4: 8-Bit Adder} |
| 22 | + \end{center} |
| 23 | + \begin{itemize} |
| 24 | + \item What are the data path widths (number of bits) for A, B, and Sum? |
| 25 | + \hfill\ans[1.5in]{8, 8, and 8} |
| 26 | + |
| 27 | + \item What are the data path widths for Carry In and Carry Out? |
| 28 | + \hfill\ans[1in]{1 and 1} |
| 29 | + |
| 30 | + \item How is this 8-Bit Adder different from the one shown in Figure 1? |
| 31 | + \begin{answer}[0.75in] |
| 32 | + It has a carry in and carry out. |
| 33 | + \end{answer} |
| 34 | + |
| 35 | + \item If you were to use this 8-Bit Adder in the circuit shown in Figure 1, what value would you need for Carry In? |
| 36 | + What circuit component (from an earlier lesson) would you attach to the Carry In line to do proper math? |
| 37 | + \begin{answer}[1in] |
| 38 | + Carry in should always be zero; this can be achieved with ground. |
| 39 | + \end{answer} |
| 40 | + |
| 41 | + \item What component would you add to the Carry Out line to ignore the overflow bit? |
| 42 | + \begin{answer}[0.75in] |
| 43 | + Carry out could be attached to ground. |
| 44 | + \end{answer} |
| 45 | + |
| 46 | + \item If the carry lines are ignored for simple 8-bit addition, why do they exist? |
| 47 | + \begin{answer}[0.75in] |
| 48 | + So that we can do complex addition (say, 16-bit values). |
| 49 | + \end{answer} |
| 50 | + \end{itemize} |
| 51 | + |
| 52 | + \vspace{-40pt} |
| 53 | + |
| 54 | + \Q Consider the expression with two unsigned hexadecimal integers: (2345$_{16}$ + 3456$_{16}$)\key\\[-2.5mm] |
| 55 | + \begin{itemize} |
| 56 | + \item How many bits are required for each number? |
| 57 | + \begin{answer}[0.5in] |
| 58 | + 4 bits for each digit, so 16-bits for each number. |
| 59 | + \end{answer} |
| 60 | + |
| 61 | + \item How many bits are required to represent the sum? |
| 62 | + \begin{answer}[0.5in] |
| 63 | + The value 579B$_{16}$ is also just 16 bits. |
| 64 | + \end{answer} |
| 65 | + |
| 66 | + \item Describe how you would use an 8-Bit Adder to perform this operation. |
| 67 | + \begin{answer}[1.5in] |
| 68 | + Add the low-order bytes: 45$_{16}$ + 56$_{16}$ = 9B$_{16}$ \\ |
| 69 | + Add the high-order bytes: 23$_{16}$ + 34$_{16}$ = 57$_{16}$ \\ |
| 70 | + Combine the high-order and low-order bytes to get the result of 579B$_{16}$ |
| 71 | + \end{answer} |
| 72 | + \end{itemize} |
| 73 | + |
| 74 | + \Q Consider the expression with two unsigned hexadecimal integers: (2385$_{16}$ + 3496$_{16}$). |
| 75 | + \begin{itemize} |
| 76 | + \item How would you use the Carry In line to add the low-order 8 bits (85$_{16}$ + 96$_{16}$)? |
| 77 | + \begin{answer}[0.75in] |
| 78 | + The carry-in value should be zero. |
| 79 | + \end{answer} |
| 80 | + |
| 81 | + \item How would you use the Carry In line to add the high-order 8 bits? |
| 82 | + \begin{answer}[1in] |
| 83 | + The carry-in value for the high-order addition should be the (saved) carry out for the low-order addition. |
| 84 | + \end{answer} |
| 85 | + |
| 86 | + \item Suggest a name for this new kind of Add command. |
| 87 | + \begin{answer}[0.75in] |
| 88 | + Add with carry. |
| 89 | + \end{answer} |
| 90 | + \end{itemize} |
| 91 | + |
| 92 | + \Q What does the circuit in Figure 1 use to hold intermediate 8-bit sums? |
| 93 | + \begin{answer}[0.75in] |
| 94 | + An 8-bit latch. |
| 95 | + \end{answer} |
| 96 | + |
| 97 | + \Q What has been added in Figure 5 compared to Figure 4? |
| 98 | + \vspace{10pt} |
| 99 | + \begin{center} |
| 100 | + \includegraphics[width=0.35\textwidth]{figures/add_with_carry.png} |
| 101 | + \par\vspace{5pt} |
| 102 | + {\small Figure 5: Add with Carry} |
| 103 | + \end{center} |
| 104 | + |
| 105 | + \begin{answer}[0.75in] |
| 106 | + A Use Carry control line and a carry buffer or latch. |
| 107 | + \end{answer} |
| 108 | + |
| 109 | + \Q If we used 0x20 as the code for the Add with Carry instruction, how would it differ from the Add instruction code? |
| 110 | + \begin{answer}[1in] |
| 111 | + It has a 1 in bit 5 (the 6th bit from the right), while all other are 0. |
| 112 | + \end{answer} |
| 113 | + |
| 114 | + \Q If we attached bit 5 of the instruction decoder to the ``Use Carry'' control line, what logic gate(s) would provide the desired behavior? |
| 115 | + \begin{answer}[1in] |
| 116 | + An AND gate would have a 1 out if both the carry latch and the use carry control line are 1. |
| 117 | + \end{answer} |
0 commit comments