CH 3 Digital Logic Level
CH 3 Digital Logic Level
Implementation
• Write down the truth table for
the function.
• Provide inverters to generate
the complement of each input.
• Draw an AND gate for each
term with a 1 in the result
column.
• Wire the AND gates to the
appropriate inputs.
FIGURE 3.3
(a) Truth table of three • Feed the output of all the AND
variables (b) Circuit for (a) gates into an OR gate.
(a) Truth table for 1-bit addition. (b) A circuit for a half adder.
CST301 Computer Organization FCST, UCSY Digital Logic Level: 3 – 21 / 59
ADDERS - FULL ADDER
Digital Logic Level
Gates and Boolean Algebra
• Gates
• A full adder is built up from two half adders.
• Boolean Algebra
• Implementation of Boolean • The Sum output line is 1 if an odd number of A, B, and the Carry in
Functions
• Circuit Equivalence are 1.
Basic Digital Logic Circuits
• Integrated Circuits
• Combinational Circuits
• The Carry out is 1 if either A and B are both 1 (left input to the OR
o Multiplexers
o Demultiplexers
gate) or exactly one of them is 1 and the Carry in bit is also 1.
o Decoders
o Comparator • Together the two half adders generate both the sum and the carry
• Arithmetic Circuits
o Shifters bits.
o Half Adder
o Full Adder
o ALU
• Clocks
Memory
• Latches
• Flip-Flops
• Registers
• Memory Organization
• Memory Chips
o 4 Mbit
o 512 Mbit
CPU Chips and Buses
• CPU Chips
• Computer Buses
• Bus Width
• Bus Clocking
o Synchronous Bus
o Asynchronous Bus
• Centralized Bus Arbitration
• Decentralized Bus Arbitration
• Bus Operations
(a) Truth table for full adder. (b) Circuit for a full adder.
CST301 Computer Organization FCST, UCSY Digital Logic Level: 3 – 22 / 59
ADDERS - FULL ADDER
Digital Logic Level
Gates and Boolean Algebra
• Gates Ripple Carry Adder
• Boolean Algebra
• Implementation of Boolean
Functions • The carry out of a bit is used as the carry into its left neighbor.
• Circuit Equivalence
Basic Digital Logic Circuits
• Integrated Circuits
• The carry into the rightmost bit is wired to 0.
• Combinational Circuits
o Multiplexers • This type of adder is called a ripple carry adder.
o Demultiplexers
o Decoders
o Comparator
• Arithmetic Circuits
o Shifters Carry Select Adder
o Half Adder
o Full Adder
o ALU • For a faster adder, consider breaking up a 32-bit adder into a 16-bit
• Clocks
Memory lower half and 16-bit upper half.
• Latches
• Flip-Flops
• Registers
• Instead of having a single upper half, give the adder two upper halves
• Memory Organization in parallel by duplicating the upper half.
• Memory Chips
o 4 Mbit
o 512 Mbit • The circuit consists of three 16-bit adders: a lower half and two upper
CPU Chips and Buses
• CPU Chips
halves, U0 and U1 that run in parallel.
• Computer Buses
• Bus Width • After a 16-bit addition times, it will be known what the carry into the
• Bus Clocking
o Synchronous Bus upper half is, so the correct upper half can be selected from the two
o Asynchronous Bus
• Centralized Bus Arbitration variable answers.
• Decentralized Bus Arbitration
• Bus Operations • This adder reduces the addition time by a factor of two.
A clock in this context is a circuit that emits a series of pulses with a precise pulse
width and precise interval between consecutive pulses.
• Clock Cycle Time: The time interval between the corresponding edges of two consecutive pulses
is known as the clock cycle time.
• Pulse frequencies are commonly between 100 MHz and 4 GHz, corresponding to clock cycles of
10 nsec to 250 psec.
• To achieve high accuracy, the clock frequency is usually controlled by a crystal oscillator.
A clocked SR latch.
CST301 Computer Organization FCST, UCSY Digital Logic Level: 3 – 28 / 59
CLOCKED D LATCHES
Digital Logic Level
Gates and Boolean Algebra
• Gates
• A latch circuit with only one input, D, where the input to the lower AND
• Boolean Algebra
• Implementation of Boolean
gate is always the complement of the input to the upper one, the
Functions
• Circuit Equivalence
problem of both inputs being 1 never arises.
Basic Digital Logic Circuits
• Integrated Circuits • When D = 1 and the clock is 1, the latch is driven into state Q = 1.
• Combinational Circuits
o Multiplexers • When D = 0 and the clock is 1, it is driven into state Q = 0.
o Demultiplexers
o Decoders
o Comparator
• In other words, when the clock is 1, the current value of D is sampled
• Arithmetic Circuits
o Shifters
and stored in the latch.
o Half Adder
o Full Adder • This circuit, called a clocked D latch, is a true 1-bit memory.
o ALU
• Clocks • The value stored is always available at Q. To load the current value of
Memory
• Latches D into the memory, a positive pulse is put on the clock line.
• Flip-Flops
• Registers
• Memory Organization
• Memory Chips
o 4 Mbit
o 512 Mbit
CPU Chips and Buses
• CPU Chips
• Computer Buses
• Bus Width
• Bus Clocking
o Synchronous Bus
o Asynchronous Bus
• Centralized Bus Arbitration
• Decentralized Bus Arbitration
• Bus Operations
A clocked D latch.
CST301 Computer Organization FCST, UCSY Digital Logic Level: 3 – 29 / 59
FLIP-FLOPS
• In many circuits it is necessary to sample the value on a certain line at a particular instant
in time and store it.
• In this variant, called a flip-flop, the state transition occurs not when the clock is 1 but
during the clock transition from 0 to 1 (rising edge) or from 1 to 0 (falling edge) instead.
• The difference between a flip-flop and a latch
o A flip-flop is edge triggered
o A latch is level triggered
• Two of the key parameters that determine the performance of a CPU are
the number of address pins and the number of data pins.
• A chip with m address pins can address up to 2𝑚 memory locations.
Common values of 𝑚 are 16, 32, and 64.
• Similarly, a chip with 𝑛 data pins can read or write an n-bit word in a
single operation. Common values of 𝑛 are 8, 32, and 64.
• The original IBM PC • Intel flet it had to increase the • Unfortunately, more control
contained an 8088 CPU and address space to 16 MB, so lines had to be added to deal
a 20-bit address bus. four more bus lines were with the new address lines.
added.
• Having 20 bits allowed the • When the 80386 came out,
PC to address 1 MB of (without disturbing the original 20, another eight address lines
memory. for reasons of backward were added, along with still
compatibility) more control lines.
• Decentralized bus arbitration uses only three lines, no matter how many devices are present.
• The first bus line is a wired-OR line for requesting the bus.
• The second bus line is called BUSY and is asserted by the current bus master.
• The third line is used to arbitrate the bus.
• To acquire the bus, a device first checks to see if the bus is idle and the arbitration signal it is
receiving, IN, is asserted.
• If IN is negated, it may not become bus master, and it negates OUT.
• If IN is asserted, the device wants the bus, the device negates OUT, which causes its
downstream neighbor to see IN negated and to negate its OUT.
• When the dust settles, only one device will have IN asserted and OUT negated.
• This device becomes bus master, asserts BUSY and OUT, and begins its transfer.
A block transfer.
CST301 Computer Organization FCST, UCSY Digital Logic Level: 3 – 57 / 59
BUS OPERATIONS (INTERRUPT VECTORS)
• Another important kind of bus cycle is for handling interrupts.
• When the CPU commands an I/O device to do something, it usually expects an interrupt
when the work is done. The interrupt signaling requires the bus.
• Since multiple devices may want to cause an interrupt simultaneously, the same kind of
arbitration problems are present here that we had with ordinary bus cycles.
• The usual solution is to assign priorities to devices and use a centralized arbiter to give
priority to the most time-critical devices.
• Standard interrupt interfaces exist and are widely used.
• The CPU hardware uses the number to index into a table of pointers, called interrupt
vectors, to find the address of the procedure to run to service the interrupt.