Saturday, 13 October 2012

Digital Logic- Decoder, Multiplexer, Programmable Logic Array, by Quek Xin Yi


Decoder
·         A decoder is a combinational circuit with a number of output lines, but only one output is asserted at any time, depending on input pattern.
·         A decoder has n inputs and 2n outputs.
·         The examples of decoder are 2-to-4 decoder and 3-to-8 decoder.
·         One of the examples of decoder in digital computers is address decoding.
·         A decoder is useful in selecting a memory location according to a binary value placed on the address line of a memory bus.






·         From the truth table, the decoded output appears only when the encoded input is present and the enable line has value of 1, but the other outputs are 0.



Multiplexer (MUX, or known as selector)
·        What is a multiplexer?
Multiplexer selects a single output from several inputs, the input chosen for output is determined by the value of the multiplexer’s control lines, by using log2n control lines.

·        Functions of multiplexor?
-          Has the opposite function as decoder.
-          Multiplexers are mainly used to increase the amount of data that can be sent over the network within a certain amount of time and bandwidth.
-          They are used in CCTV, as multiplexer enable several signals to share one device or resource, instead of having one device per input signal.

·        Demultiplexer(demux)
A device taking a single input signal and selecting one of many data-output-lines, which is connected to the single input.

·         A multiplexer is often used with a complementary demultiplexer on the receiving end. 

 Programmable Logic Array(PLA)
·        What is PLA?
a)      PLA consist of a small PROM (programmable read-only memory) core and additional output logic used to implement particular desired logic functions with few components.
b)      Each PLA device was "one-time programmable" (OTP), meaning that it could not be updated and reused after its initial programming.
c)      PLA was introduced to replace the small-scale integration(SSI)components. SSI included a variety of logic building blocks, such as gates (NOT, NAND, NOR, AND, OR), multiplexers and demultiplexersand others.

·        How PLA function?
-          PLA is based on the fact of Boolean function(truth table) can be expressed in sum of product(SOP).

·         Most larger PLAs consist of several hundred gates, 15-25 inputs, and 5-15 outputs.

·         Connections from inputs to AND gates and from AND gates to OR gates are not specified.

·         manufactured in these two ways:
1.      Every possible connection is made through a fuse at every intersection point.
Undesired connections can be removed by blowing the fuses.(Field-programmable logic)
2.      The proper connections can be made during chip fabrication by using an appropriate mask supplied for a particular interconnection pattern.

·         In conclusion, PLA is flexible, inexpensive way of implementing digital logic functions.


Written by,
Quek Xin Yi
B031210203


Thursday, 11 October 2012

Digital Logic - Read-only Memory and Adder, by Lai Wai Kuen


Read-only memory (ROM)
What is read-only memory in computer organization and architecture?
Read-only memory (ROM)
·         is one of type of a non-volatile computer memory types which means that storage that remain its data when power is removed.
·         is a class of memory-storage devices used in computers and other electronic devices.
·          is one sort of memory that is implemented with combinational circuits
o   Combinational circuits often referred as “memoryless” circuits because the output of
combinatinal circuits depends only on their curret input and no history of prior inputs is retained.
·          is a memory unit that performs only the read operation.
o   So the binary information stored in a ROM is permanent and was created during the fabrication process.
o   Thus, a given input to the ROM (address lines) always produces the same output (data lines).
o   Due to the outputs are a function only of the present inputs, the ROM is the fact a combinational circuit.

Notes
Storage can be internal or external (auxiliary)
Internal storage
·         Main memory or random access memory (RAM)
·         Other memory is read-only memory (ROM)
·         Both hardware and software: firmware
External (auxiliary)storage
·         Hard disks, floppy disks, magnetic tape
·         Flash drives
Data stored in ROM cannot be modified

Used
·         for storing programs
·         for storing data

A good example of ROM is EEPROM(erasable programmable read only memory), which is used for the computer BIOS.

Did ROM implemented with others?
A ROM can be implemented with a decoder and a set of OR gates.As an example,consider table A.8 below

This can be viewed as a truth tables with  4 inputs and 4 outputs. For each of the 16 possible input values, the corresponding set of values of the outputs is shown. It can be viewed as defining the contents of a  64-bit ROM consisting of 16 words of 4 bits each. The 4 inputs specify an address, and the 4 outputs specify  the contents of the location specified by the address.

Adder
What is adder in computer organization and architecture?
Adder
·         or known as summer is a digital circuit that performs addition of numbers
Used
adders are used in the
·          arithmetic logic unit(s),
·         other parts of the processor that are used to calculate addresses, table indices, and similar operations.
What is half adder in computer organization and architecture?
Half adder is a combinational circuit which performs addition of two bits

A half-adder adds two 1-bit inputs and produces a sum bit and a carry bit as outputs.
Half adder



Half Adder Logic Diagram
The half adder adds two single binary digits A and B. Sum(S) and carry(C) is the two outputs. The carry(C) signal represents an overflow into the next digit of a multi-digit addition. The value of the sum is 2c+s. The simplest half-adder design, pictured on the top, incorporates an XOR gate for S and an AND gate for C. With the addition of an OR gate to combine their carry outputs, two half adders can be combined to make a full adder.

We can use two half adder to create a full adder by the following way
            
         

Full Adder
What is full adder  in computer organization and architecture?
A full adder
·         is a logical circuit that performs an addition operation on three one-bit binary numbers(A, B and Carry(in)).
·         is also called a (3,2) adder because it has 3 inputs and 2 outputs.
·         produces a sum and a carry(out).
·         A and B are the operands, and Cin is a bit carried in from the next less significant stage.
·          The full-adder is usually a component in a cascade of adders, which add 8, 16, 32, etc. binary numbers.
·         The circuit produces a two-bit output sum typically represented by the signals Cout and S, where  . The one-bit full adder's truth table is:

References


Written by,
Lai Wai Kuen
B031210027

Digital logic - Sequential Circuits, by Goh Hooi Kuan


Sequential Circuits

4.1            Introduction

Combination circuits whose outputs are function of only the inputs were discussed. However, in many digital designs there is a need for logic circuits whose outputs depend not only on the present inputs, but also on the past values of the input and output, of the circuit.
In other words, the concept of time has to be introduced, and memory circuits are required to store information about the past history of the circuit. Such circuits are known as sequential logic circuits, because they follow a predetermined sequence. There are numerous examples of sequential circuits, one of the most widely met being the traffic light controller, which may be regarded as a black box, as shown in Figure 4.1.



There are 3 outputs, labeled Red, Yellow and Green, to drive the 3 traffic lights, and a single input, labeled clock. A light will be turned on if there is a 1 on its output line. Fundamental to the design of sequential circuits is the concept of internal states.
The simple traffic light controller requires 4 states, labeled S0, S1, S2 and S3, as shown in Figure 4.2. The lines drawn from 1 state to another show the transition between states. The input signal (or input signal combinations) that gives rise to each transition is indicated above the arrow. Each transition between states is initiated by a clock signal, clk, as there are no other input signals in this simple example. Those outputs that are turned on in a given state are shown either alongside, or inside the state circles. For example, in state S1, Red and Yellow are on (1), while Green is off (0).


                    

4.2 Synchronous and Asynchronous Sequential Circuits

There are 2 fundamentally different types of sequential circuit, namely synchronous and asynchronous. In a asynchronous (or event driven) circuit there is no clock, and transitions between states are initiated by changes in the appropriate input signals. In a synchronous circuit, transitions between states are initiated by a pulse from a single clock. It is normally assumed that any changes in the input signals occur between clock pulses, so that the input signals are stable when a clock pulse is applied. Synchronous circuits are easier to design, and so this text will be restricted to them.
Figure 4.3 shows 2 typical clock signals. The first is a repetitive signal, derived from an oscillator circuit, and has a constant frequency, f. At any instant in time, its value is either 0 or VH where VH is the voltage that corresponds to a 1 for the being used to implement the sequential design (typically 5 volts). The period T of this clock signal is related to its frequency by T = 1/f. The second clock signal although repetitive, does not have a constant frequency. It is often referred to as a pulsed clock, the pulses being generated in response to a change in one or more of the input signals. A synchronous circuit is designed to change state either when the clock goes from low to high, a positive edge transition, or when the clock goes from high to low, a negative edge transition. The arrows in Figure 4.3 indicate the positive transitions of the clock.



4.3 D-type flip-flops

There are 4 states, labeled S0 to S3, 2 state variables are required, X and Y, say.
Each state variable is implemented with a D-type flip-flop, so in this example 2 flip-flops are used. Both the inputs and the outputs of the flip-flops are labeled with the suffixes X and Y, respectively. The clock inputs are connected together, and are driven from a single clock source, There are now 2 remaining problems, both involving combinational logic, namely the interconnections required to the D inputs of each flip-flop, and the logic required to generate the Red, Green and yellow output signals from the state variables X and Y. The interconnections required to the Dinputs of the flip-



flops are found by slightly modifying the state table. This table for the traffic light controller is shown in Table 4.7. The states are now shown by their state variables; the assignment of each variable combination to a given state is up to the designer but it is simplest, at least initially, to follow the normal binary sequence. Note, however, that the choice of state variables can alter the amount of hardware require to implement the necessary combinational logic; other assignments may result in less hardware.





This equation shows that the next output, or state, of the flip-flop is just equal to the present value of the D input. Thus the entries in Table 4.7 for the next state are just those required for the D inputs, Dx and Dy.
Scanning down the column labelled Y’ shows that there are only two 1 entries, corresponding to the present states S1 (Y’.X) and S2 (Y,X’), so that :
DY  =  Y’ . X + Y .X’ = X+ Y
Similarly for the X’ column there are also two 1 entries corresponding to states S0 and S2, and so :
DX  =  Y’ . X + Y .X’ = X’
Figure 4.12 shows the two D-type flip-flops with the logic required to generates DX and DY. Finally the logic required to generate the output signals must be determined. Returning to the state diagram, it will be seen that the following output signals are required.


4.4  Register

            A register is a device in which a number of binary digits (bits) can be stored and retrieved, or read back. The use of a D-type flip-flop to store a single bit of information. The data bit to be stored in, or written to, the memory (0,1) is placed on the D input and a clock pulse is then applied to the clock input. This results in the data bit being stored in the flip-flop. Its value can be ascertained at any time from the memory by reading the value of the Q output. A set of n of these D-type flip-flops, fabricated as a single unit, can be used to store n bits of information, and is known as a register. Frequently, n is a power of 2, usually 4, 8, 16, 32 or 64. Figure 4.22 is a schematic diagram of a single 4-bit register.
The inputs are labeled D0 to D3, and the outputs Q0 to Q3. The pattern of bits stored in the register will be referred to as a (4-bit) word. The 4 clock inputs to the individual flip-flops within the register are connected to a common clock line. When a pulse is applied to this line the data on the output lines are written into the memory, over-writing the previous word stored.



4.5  Counter

            Counters are a special class of finite state machine. A counter follows a preset sequence and repeatedly outputs the same pattern. The simplest counter is the binary-up counter in which the counter is incremented by one each time a clock pulse occurs, until the maximum count is reached. Figure 4.19 shows the state diagram for a modulo-8 counter.



By convention the count begins at 0 and is then incremented by 1 on the next clock pulse until the maximum of 7 occurs. When the next clock pulse occurs the counter is reset to zero, and the sequence starts again. There are no inputs, apart from the clock. Eight states require 3 state variables, X, Y and Z. Where possible the state assignments are made so that the circuit outputs are just the state variables, X, Y and Z. Thus, S0 = 000, S1 = 001 etc.
The design of a synchronous counter proceeds in exactly the same way as discussed above for any synchronous sequential circuit. For example, consider the design of a modulo-3 up/down synchronous counter. This counter has a single input labelled up/down, in addition to the normal clock. If up/down = 1 the counter is to count up in the normal way, following the sequence 0, 1, 2, 0, …, while if up/down = 0 it is required to count down following the sequence 0, 1, 2, 0, … There are 3 states, so two state variables are required, X and Y. In normal operation the 4th state, state 4, is never entered and so could be regarded as a ‘don’t care’ state. However, if state is ever entered (Eg : as the random state entered when power is first switched on) then the next state should be one of the 3 states, state 0 say, so that the count sequence is properly resumed.



In this example it will be assumed that each of the state variables, X and Y, is stored in a JK flip-flop, as shown in Figure 4.20. As before, the problem comes down to designing the combinational logic required for the connections to the J and k inputs of the 2 flip-flops, and the logic to generate the output signals. The logic is determined by expanding the state table into a new modified table, called an excitation table, Table 4.10 (b). Again the normal binary pattern has been assumed for the state variables. The column labelled JK flip-flop controls is filled in with the aid of the JK flip-flop state change table, table 4.6.




The decision on whether to use D-type or JK flip-flops is really a matter of designer choice. A JK flip-flop implementation is slightly more difficult to design, but will often result in less hardware being required for the combinational logic, than an equivalent design using D-type flip-flops.
Another type of counter that is frequently used is the asynchronous or ripple counter. These counters use JK flip-flops connected in the toggle mode, with J = K = 1.Figure 4.21 (a) shows a modulo-16 ripple counter. The pulses to be counted are applied to the clock input of the first JK flip-flop. The output of this flip-flop, QA, is applied to the clock input of the second flip-flop. Its output is applied in turn to the clock input of the third flip-flop, and so on.



The first flip-flop toggles, that is, changes state, on the rising edge of each of the pulses to be counted. It effectively divides the pulse frequency by 2. The second flip-flop toggles on every rising edge of QA, so effectively dividing the input pulse frequency by 4. The outputs of the flip-flops are thus a binary count of the input pulses, with QA being the least significant digit, and QD the most significant digit. Clearly the design can be extended to any number of stages to produce a modulo-N counter, but with the limitation that N is a power of two. It is also possible to design ripple counters where n is not a power of two, but their design is not considered here. Note also that a modulo-N counter may also be used as a divide-by-N frequency divider, dividing the input frequency by N, N2, N4, etc. The name ‘ripple counter’ comes from the fact that changes in the state of the counter ripple through the chain of flip-flops, with the result that there is a propagation delay between the outputs of the flip-flops changing. If this is important, then a synchronous counter must be used. In such a counter, all the changes occur instantaneously coincident with the clock pulse.


Written by,
Goh Hooi Kuan
B031210043