Boolean Algebra and Digital Circuits Part 3: Logic Gates and Combinatorial Circuits
Logic Gates a gate implements a simple boolean function such as AND, OR or NOT constructed using a few transistors basic building block of digital design AND. OR + NOT XOR (the circle in the NOT gate represents complement)
Universal Gates recall that all other gates can be constructed using NAND gates alone, or NOR gates alone so these are our universal gates NAND. NOR +
Multiple Inputs and Outputs z OR ++z three input OR gate z AND..z three input AND gate AND Q =. Q =. two output AND gate adapted from figs 3.6-3.8, Computer Organization & Architecture
Digital Circuits we can build boolean functions using gates: F(,, z) = +.z z F and sum of products can make construction simple: F = z + z + z F and for efficienc we could alwas simplif further b using kmaps before construction z
Subtle Uses of Logic Gates the functionalit we see in high-level languages is built upon lower level circuits and sometimes this can be eploited to improve efficienc and performance: using XOR to swap 2 variables' values: = XOR = XOR = XOR using AND to mask bits: for a bte z, to find if its 4th bit is set use z AND 000010002 in general, set the bits ou want to keep to 1, set others to 0, then AND with our bte (/word)
Integrated Circuits a modular approach we've seen that individual gates can be combined to perform more comple functions however gates aren't usuall manufactured individuall but instead a collection of them are etched onto an integrated circuit we use one or man of these ICs to create a boolean function
IC Small Scale Integration (SSI) Eample here's an integrated chip with just four NAND gates (note that modern chips have VLSI or ULSI) 1 2 3 4 5 6 7 figure 3.10, Computer Organization & Architecture
Implementing a Function on the Simple IC F F(,) = + converted to just NANDs = (. ). (. ) 1 2 3 4 5 6 7
Combinatorial Circuits the eamples we've seen so far are combinatorial circuits the output is based entirel upon the input values the produce an output at the (notional) instant when the input values are specified so all input values must arrive at the same time for them to work the can't 'remember' the inputs if some arrive later than others we'll see later what to do if the inputs arrive sequentiall for now we'll look at some useful combinatorial circuits
Half-Adder we want to be able to add binar numbers in the Arithmetic Logic Unit (ALU) let's start with a half-adder which can add two bits together: so could we simpl combine a set of half-adders to perform addition on words of an size we choose? no, because we need to account for the carr in table 3.9, figure 3.11, Computer Organization & Architecture
Full-Adder a full-adder takes account of the carr in......and we see how the half-adder got it name figure 3.12, Computer Organization & Architecture
Ripple-Carr Adder the full-adder can be combined to create a ripple-carradder which can add words together figure 3.13, Computer Organization & Architecture note that in realit we now have far more efficient adders (40%-90% faster!) through the use of optimisations based upon parallelisation and handling of the carr bit
Decoder uses the combination of the input values to select one specific output line so, with two inputs and, there are 4 possible combinations:.,.,.,. and we create an output line for each: figure 3.14, Computer Organization & Architecture this is useful for building circuits which can determine which memor address to access, or which function to perform based upon the input
Multipleer selects a single output from several inputs uses control lines to determine which input to route like the inputs & output of a home theatre receiver figure 3.14, Computer Organization & Architecture
Simple 2-bit ALU control codes: 00 = A + B 01 = NOT A 10 = A OR B 11 = A AND B figure 3.15, Computer Organization & Architecture
Simple 2-bit ALU 0 1 1 0 1 0 OR function enabled (code 10) with inputs of 01 & 10 and an output of 11 figure 3.15, Computer Organization & Architecture
To Conclude we can build comple circuits in a modular fashion either b combining individual gates or b combining integrated circuits but so far these circuits require that the inputs arrive and are handled at the same time the are memorless so net lecture we'll see how to account for memor and timing needs
References & Further Learning outline primaril based upon: Chapter 3, Computer Organization & Architecture (3rd Edition), Null & Lobur other material used for reference: Chapter 3, Fundamentals of Computer Architecture, Burrell suggested learning activities: make sure that ou understand how the full adder works perhaps trace the flow for a 4-bit adder tr to follow instructions through the simple 2-bit ALU