This preview shows page 1. Sign up to view the full content.
Unformatted text preview: th the same weight as the input bits and a carry bit which has twice that weight. Binary numbers Binary addition Appendix: Computer Logic 401 If the inputs are A and B, the sum and carry are formed as follows: sum = AB+AB Equation 18 Equation 19 carry = AB The sum function arises frequently in digital logic and is called the exclusive OR or XOR function. It is 'exclusive' because it is true if A is true, or B is true, but not if they are both true. It has its own logic symbol which is shown in Figure A.3 along with a (nonobvious) implementation which uses four NAND gates. Figure A.3 The logic symbol and NAND circuit for an XOR gate. An adder for Nbit binary numbers can be constructed from singlebit adders, but all bits except the first may have to accept a carry input from the next lower stage. Each bit of the adder produces a sum and a carryout from the inputs and the carryin: sum, Q =^4j5jCi.1 +AiBiCi.l + AiBiCi.l+A^B^C^ =y415i+/4iCi.i+5iC1.1 Equation 20 Equation 21 Here the equations apply for i= 1 toN and C0 is zero. Multiplexers A common requirement in a processor implementation is to select the source of an operand from a number of alternative inputs on a cyclebycycle basis. The logic component that performs this function is a multiplexer (or simply a 'mux'). A 2input multiplexer has a Boolean select input (S) and two binary input values At and BI, where 1 <i<NandN is the number of bits in each binary value. When 5 is zero, the output Z; should equal^j and when S is one Z\ should equal Br This is a straightforward logic function: Equation 22 <r>. .   402 Appendix: Computer Logic Clocks Almost all processors are controlled by a freerunning timing reference signal called a clock. (But not quite all; see Chapter 14 on page 374 for details of the AMULET processor cores that operate without any external timing reference signal). The clock controls the state changes within the processor. Generally, all the state is held within registe...
View Full
Document
 Spring '09
 Staff

Click to edit the document details