Digital Circuits

Zoltan Padrah edited this page Aug 22, 2012 · 1 revision
Clone this wiki locally

We can Simulate logical circuits using ktechlab. Let us first stimulate logic gates.

Table of Contents

Logic Gates

Logic gates process signals which represent true or false. Normally the positive supply voltage +Vs represents true and 0V represents false. Some basic gates are discussed below.

  • NOT Gate
  • The output Q is true when the input A is NOT true
  • AND Gate
  • if input A AND input B are both true then the output is true.
  • OR Gate
  • The output Q is true if input A OR input B is true (or both of them are true)
  • NAND Gate
  • If a NOT gate is connected to the output of AND gate we get a NAND gate
  • NOR Gate
  • If a NOT gate is connected to the output of OR gate we get a NOR gate

Figure below shows the simulations of Logical gates using KTechLab



Flip-flops are synchronous bistable storage devices capable of storing one bit. In this case synchronous means, the output changes are synchronised with the clock signal, ie the output changes when the clock changes. There are several types of flip-flops, the common ones of which are described in the following paragraphs.

The Set-Reset (S-R) Flip-flop

The Set-Reset (SR) flip-flop has two inputs, namely, a Set input, or S, and a Reset input, or R. It also has two outputs, the main output Q and its complement Q. A simple representation of an S-R flip-flop is a pair of cross-coupled NOR gates, i.e, the output of one gate is tied to one of the two inputs of the other gate and vice versa. The free input of one NOR gate is used as R while the free input of the other gate is used as S. The output of the gate with the ‘R’ input is used as the Q output while the output of the gate with the ‘S’ input is used as the Q output. Thus, resetting an S-R flip-flop’s output Q to ‘0’ requires R=1 and S=0, while setting Q to ‘1’ requires S=1 and R=0. In real-world applications, flip-flops are ‘clocked’ so that one can control the exact moment at which the output changes its state in response to changes in inputs. The clock digital input of clocked flip-flops is usually denoted as C.

The J-K Flip-flop

The J-K flip-flop differs from the S-R flip-flop in the sense that its next output is determined by its present output state as well, besides the states of its inputs. Note that in the J-K flip-flop, the S input is now called the J input and the R input is now called the K input. Thus, in a JK flip-flop, the output will not change if both J and K are ‘0’, but will toggle to its complement if both inputs are ’1’.

Construct a simple four bit counter using J-K Flip flop. Circuit is shown below. This counter counts from 0000 to 1111, ie is from 0 to 15.


Note that there is a resitance connected between led and the output of the J-K flip flop(Q). This aviods the loading effect. Let us now construct a Decade counter by modifying the above circuit. The above counter counts from zero to fifteen, we have to restrict the counter such that it counts from zero to nine. For this we connect an AND gate between the Output of second and fourth Filp Flop and the output of the AND gate is connected to the reset pin of all the flip flop. When counter counts ten the output of the second and fourth flip flop become high, and the counter gets reset to 0000.


There are serval IC’s given in the Intergerated Circuit section. Some of them are,

Intergerated Circuits

Integrated circuits were made possible by experimental discoveries which showed that semicon- ductor devices could perform the functions of vacuum tubes, and by mid-20th-century technology ad- vancements in semiconductor device fabrication. The integration of large numbers of tiny transistors into a small chip was an enormous improvement over the manual assembly of circuits using discrete electronic components. The integrated circuit’s mass production capability, reliability, and building- block approach to circuit design ensured the rapid adoption of standardized IC’S in place of designs using discrete transistors. There are two main advantages of ICs over discrete circuits: cost and performance. Cost is low because the chips, with all their components, are printed as a unit by photolithography and not con- structed a transistor at a time. Performance is high since the components switch quickly and consume little power, because the components are small and close together. Among the most advanced inte- grated circuits are the microprocessors or ”cores”, which control everything from computers to cellular phones to digital microwave ovens. Digital memory chips and ASICs are examples of other families of integrated circuits that are important to the modern information society. In the below section we will discuss about various IC simulations avaliable in the KTechlab.


PIC is a family of Harvard architecture microcontrollers made by Microchip Technology, derived from the PIC1650 originally developed by General Instrument’s Microelectronics Division.PICs are popular with developers and hobbyists alike due to their low cost, wide availability, large user base, extensive collection of application notes, availability of low cost or free development tools, and serial programming (and re-programming with flash memory) capability.

555 Timer

The 555 family of timer chips can be used in either monostable mode or astable mode. In the monostable or ”one shot” mode, each time the 555 timer is triggered, the output will go high for a specified amount of time, then return to low and await another trigger signal. In the astable mode, the timer triggers itself periodically and becomes an oscillator, sending out a train of pulses. Figure below shows a square wave generator using 555.



Analog-to-digital converter (abbreviated ADC, A/D or A to D) is an electronic internal circuit(i/c) that converts continuous signals to discrete digital numbers. The reverse operation is performed by a digital-to-analog converter (DAC). Typically, an ADC is an electronic device that converts an input analog voltage ( or current ) to a digital number. The digital output may be using different coding schemes, such as binary and two’s complement binary. Figure below shows ADC and DAC together, ADC convert the input voltage to digital and DAC reconvert it into analog. It is seen that the accuracy increases as the number of bit increases(Since resolution increases). Number of bits can be increased by double clicking the ic and changing the value in the combo box.


Multiplexer and Demultiplexer

A multiplexer or mux (occasionally the term muldex is also found, for a combination multiplexer-demultiplexer) is a device that selects one of many data-sources and outputs that source into a single channel. A demultiplexer (or demux) is a device taking a single input that selects one of many data-output-lines and connects the single input to the selected output line. A multiplexer is often used with a complementary demultiplexer on the receiving end.


BCD to Sevensegment Decoder

A BCD to Seven Segment Decoder inputs data in BCD form and converts it to a seven segment output. The IC does the decoding that is involved in activating the appropriate segment outputs (a-g) that is required to represent the binary number that is input. There are 4 binary inputs to the Decoder and seven output segments (a-g).