Skip to main content


Showing posts from 2008

Finite State Machine


A machine consisting of a set of states, a start state, an input, and a transition function that maps input and current states to a next state. Machine begins in the start state with an input. It changes to new states depending on the transition function. The transition function depends on current states and inputs. The output of the machine depends on input and/or current state.

There are two types of FSMs which are popularly used in the digital design. They are
Moore machineMealy machine
Moore machine

In Moore machine the output depends only on current state.The advantage of the Moore model is a simplification of the behavior.

Mealy machine

In Mealy machine the output depend on both current state and input.The advantage of the Mealy model is that it may lead to reduction of the number of states.

In both models the next state depends on current state and input. Some times designers use mixed models. States will be encoded for representing a particular state.

Representation of a FS…

One-hot Encoding

Designing a FSM is the most common and challenging task for every digital logic designer. One of the key factors for optimizing a FSM design is the choice of state coding, which influences the complexity of the logic functions, the hardware costs of the circuits, timing issues, power usage, etc. There are several options like binary encoding, gray encoding, one-hot encoding, etc. The choice of the designer depends on the factors like technology, design specifications, etc.

One-hot encoding

In one-hot encoding only one bit of the state vector is asserted for any given state. All other state bits are zero. Thus if there are n states then n state flip-flops are required. As only one bit remains logic high and rest are logic low, it is called as One-hot encoding.
Example: If there is a FSM, which has 5 states. Then 5 flip-flops are required to implement the FSM using one-hot encoding. The states will have the following values:
S0 - 10000
S1 - 01000
S2 - 00100
S3 - 00010
S4 - 00001

State …

Microprocessor Interview Questions - 5

1. Why are program counter and stack pointer 16-bit registers?

Program Counter (PC) and Stack Pointer (SP) are basically used to hold 16-bit memory addresses.PC stores the 16-bit memory address of the next instruction to be fetched. SP stores address of stack's starting block.

2. What happens during DMA transfer?

During DMA transfers DMA controller takes control of the data transfer, and the processor will carry out other tasks.

3. Define ISR.

An interrupt handler, also known as an interrupt service routine (ISR), is a callback subroutine in an operating system or device driver whose execution is triggered by the reception of an interrupt. Whenever there is an interrupt the processor jumps to ISR and executes it.

4. Define PSW.

The Program Status Word (PSW) is a register which contains information about the current program status used by the operating system and the underlying hardware. The PSW includes the instruction address, condition code, and other fields. …

SoC : System-On-a-Chip

System-on-a-chip (SoC) refers to integrating all components of an electronic system into a single integrated circuit (chip). A SoC can include the integration of:
Ready made sub-circuits (IP)One or more microcontroller, microprocessor or DSP core(s)Memory componentsSensorsDigital, Analog, or Mixed signal componentsTiming sources, like oscillators and phase-locked loopsVoltage regulators and power management circuits
The blocks of SoC are connected by a special bus, such as the AMBA bus. DMA controllers are used for routing the data directly between external interfaces and memory, by-passing the processor core and thereby increasing the data throughput of the SoC. SoC is widely used in the area of embedded systems. SoCs can be fabricated by several technologies, like, Full custom, Standard cell, FPGA, etc. SoC designs are usually power and cost effective, and more reliable than the corresponding multi-chip systems. A programmable SoC is known as PSoC.

Advantages of SoC are:
Small size, red…

VLSI Interview Questions - 6

1. Why is NAND gate preferred over NOR gate for fabrication?

NAND is a better gate for design than NOR because at the transistor level the mobility of electrons of NAND is normally three times that of holes compared to NOR and thus the NAND is a faster gate. The gate-leakage in NAND structures is much lower. If you consider t_phl and t_plh delays you will find that it is more symmetric in case of NAND (the delay profile), but for NOR, one delay is much higher than the other(obviously t_plh is higher since the higher resistance PMOSs are in series connection which again increases the resistance).

2. Which transistor has higher gain: BJT or MOSFET and why?

BJT has higher gain because it has higher transconductance.This is because the current in BJT is exponentially dependent on input where as in MOSFET it is square law.

3. Why PMOS and NMOS are sized equally in a transmission gates?

In transmission gate, PMOS and NMOS aid each other rather than competing with each other. So…

Complex Programmable Logic Device

A complex programmable logic device (CPLD) is a semiconductor device containing programmable blocks called macro cell, which contains logic implementing disjunctive normal form expressions and more specialized logic operations. CPLD has complexity between that of PALs and FPGAs. It can has up to about 10,000 gates. CPLDs offer very predictable timing characteristics and are therefore ideal for critical control applications.

CPLDs are ideal for critical, high-performance control applications.CPLD can be used for digital designs which perform boot loader functions.CPLD is used to load configuration data for an FPGA from non-volatile memory.CPLD are generally used for small designs, for example, they are used in simple applications such as address decoding.CPLDs are often used in cost-sensitive, battery-operated portable applications, because of its small size and low-power usage.

A CPLD contains a bunch of programmable functional blocks (FB) whose inputs and output…

Introduction to Digital Logic Design

>> Introduction
>> Binary Number System
>> Complements
>> 2's Complement vs 1's Complement
>> Binary Logic
>> Logic Gates


The fundamental idea of digital systems is to represent data in discrete form (Binary: ones and zeros) and processing that information. Digital systems have led to many scientific and technological advancements. Calculators, computers, are the examples of digital systems, which are widely used for commercial and business data processing. The most important property of a digital system is its ability to follow a sequence of steps to perform a task called program, which does the required data processing. The following diagram shows how a typical digital system will look like.

Representing the data in ones and zeros, i.e. in binary system is the root of the digital systems. All the digital system store data in binary format. Hence it is very important to know about binary number system. Which is explained below.

Binary …

Microprocessor Interview Questions - 4

1. What is the size of flag register of 8086 processor?


2. How many pin IC 8086 is?

40 pin dual in-line package.

3. What is the Maximum clock frequency of 8086?

5 Mhz is the Maximum clock frequency of 8086.

4. What is meant by instruction cycle?

An instruction cycle also known as fetch-and-execute cycle and fetch-decode-execute cycle, is the time period during which a computer reads and processes a machine language instruction from its memory.

5. What is Von Neumann architecture?

The Von Neumann architecture is a computer design model that uses a processing unit and a single separate storage structure to hold both instructions and data. The instruction/data is read from storage and executed by the processing unit. It is also known as "stored-program computer".

6. What is the main difference between 8086 and 8085?

8086 is 16-bit microprocessor, where as 8085 is a 8-bit microprocessor.

7. What does EAX mean?

With the advent of the 32…

Microprocessor Interview Questions - 3

1. How many bits processor is 8086?

16-bit processor.

2. What are the sizes of data bus and address bus in 8086?

16-bit data bus, and 20-bit address bus.

3. What is the maximum addressable memory of 8086?

1MByte, because 20-bit address bus.

4. How are 32-bit addresses stored in 8086?

32-bit addresses are stored in "SEGMENT:OFFSET" format. SEGMENT and OFFSET are 16-bit values.

5. What are the 16-bit registers that are available in 8086?

The following are the 16-bit registers that are available in 8086.

8 general purpose registers:
AX - Accumulator Register
Bx - Base Register
CX - Count Register
DX - Data Register
SP - Stack Pointer
BP - Base Pointer
SI - Source Index
DI - Destination Index

4 segment registers:
CS - Code Segment
DS - Data Segment
SS - Stack Segment
ES - Extra Segment

IP - Instruction Pointer
Flag register

6. What are the different types of address modes available in 8086?

Implied - the data value/data addre…

Digital Design Interview Questions - 5

1. Expand the following: PLA, PAL, CPLD, FPGA.

PLA - Programmable Logic Array
PAL - Programmable Array Logic
CPLD - Complex Programmable Logic Device
FPGA - Field-Programmable Gate Array

2. Implement the functions: X = A'BC + ABC + A'B'C' and Y = ABC + AB'C using a PLA.

3. What are PLA and PAL? Give the differences between them.

     Programmable Logic Array is a programmable device used to implement combinational logic circuits. The PLA has a set of programmable AND planes, which link to a set of programmable OR planes, which can then be conditionally complemented to produce an output.
     PAL is programmable array logic, like PLA, it also has a wide, programmable AND plane. Unlike a PLA, the OR plane is fixed, limiting the number of terms that can be ORed together.
     Due to fixed OR plane PAL allows extra space, which is used for other basic logic devices, such as multiplexers, exclusive-ORs, and latches. Most importantly, clocked elements, typically…

Programmable Logic Array

In Digital design, we often use a device to perform multiple applications. The device configuration is changed (reconfigured) by programming it. Such devices are known as programmable devices. It is used to build reconfigurable digital circuits. The following are the popular programmable device
PLA - Programmable Logic ArrayPAL - Programmable Array Logic
CPLD - Complex Programmable Logic Device (Click herefor more details)FPGA - Field-Programmable Gate Array (Click here for more details)

PLA: Programmable Logic Array is a programmable device used to implement combinational logic circuits. The PLA has a set of programmable AND planes, which link to a set of programmable OR planes, which can then be conditionally complemented to produce an output. This layout allows for a large number of logic functions to be synthesized in the sum of products canonical forms.

Suppose we need to implement the functions: X = A'BC + ABC + A'B'C' and Y = ABC + AB'C. The following figures …



FPGA: A Field-Programmable Gate Array (FPGA) is a semiconductor device containing programmable logic components called "logic blocks", and programmable interconnects. Logic blocks can be programmed to perform the function of basic logic gates such as AND, and XOR, or more complex combinational functions such as decoders or mathematical functions. For complete details click here.

ASIC: An application-specific integrated circuit (ASIC) is an integrated circuit designed for a particular use, rather than intended for general-purpose use. Processors, RAM, ROM, etc are examples of ASICs.


ASIC rules out FPGA in terms of speed. As ASIC are designed for a specific application they can be optimized to maximum, hence we can have high speed in ASIC designs. ASIC can have hight speed clocks.

FPGAs are cost effective for small applications. But when it comes to complex and large volume designs (like 32-bit processors) ASIC products are cheaper.

FPGA ar…

Field-Programmable Gate Array

A Field-Programmable Gate Array (FPGA) is a semiconductor device containing programmable logic components called "logic blocks", and programmable interconnects. Logic blocks can be programmed to perform the function of basic logic gates such as AND, and XOR, or more complex combinational functions such as decoders or mathematical functions. In most FPGAs, the logic blocks also include memory elements, which may be simple flip-flops or more complete blocks of memory.

ASIC prototyping: Due to high cost of ASIC chips, the logic of the application is first verified by dumping HDL code in a FPGA. This helps for faster and cheaper testing. Once the logic is verified then they are made into ASICs.Very useful in applications that can make use of the massive parallelism offered by their architecture. Example: code breaking, in particular brute-force attack, of cryptographic algorithms.FPGAs are sued for computational kernels such as FFT or Convolution instead of a micropro…

Random Access Memory

Random Access Memory (RAM) is a type of computer data storage. Its mainly used as main memory of a computer. RAM allows to access the data in any order, i.e random. The word random thus refers to the fact that any piece of data can be returned in a constant time, regardless of its physical location and whether or not it is related to the previous piece of data. You can access any memory cell directly if you know the row and column that intersect at that cell.
    Most of the RAM chips are volatile types of memory, where the information is lost after the power is switched off. There are some non-volatile types such as, ROM, NOR-Flash.

SRAM: Static Random Access Memory
SRAM is static, which doesn't need to be periodically refreshed, as SRAM uses bistable latching circuitry to store each bit. SRAM is volatile memory. Each bit in an SRAM is stored on four transistors that form two cross-coupled inverters. This storage cell has two stable states which are used to denote 0 and 1. Two addi…

Direct Memory Access

Direct memory access (DMA) is a feature of modern computers that allows certain hardware subsystems within the computer to access system memory for reading and/or writing independently of the central processing unit. Computers that have DMA channels can transfer data to and from devices with much less CPU overhead than computers without a DMA channel.

Principle of DMA

DMA is an essential feature of all modern computers, as it allows devices to transfer data without subjecting the CPU to a heavy overhead. Otherwise, the CPU would have to copy each piece of data from the source to the destination. This is typically slower than copying normal blocks of memory since access to I/O devices over a peripheral bus is generally slower than normal system RAM. During this time the CPU would be unavailable for any other tasks involving CPU bus access, although it could continue doing any work which did not require bus access.

A DMA transfer essentially copies a block of memory from one device to anot…


Setup and Hold TIme

Every flip-flop has restrictive time regions around the active clock edge in which input should not change. We call them restrictive because any change in the input in this regions the output may be the expected one (*see below). It may be derived from either the old input, the new input, or even in between the two. Here we define, two very important terms in the digital clocking. Setup and Hold time.
The setup time is the interval before the clock where the data must be held stable.The hold time is the interval after the clock where the data must be held stable. Hold time can be negative, which means the data can change slightly before the clock edge and still be properly captured. Most of the current day flip-flops has zero or negative hold time.

In the above figure, the shaded region is the restricted region. The shaded region is divided into two parts by the dashed line. The left hand side part of shaded region is the setup time period and the right hand side part is the hold time…

Parallel vs Serial Data Transmission

Parallel and serial data transmission are most widely used data transfer techniques. Parallel transfer have been the preferred way for transfer data. But with serial data transmission we can achieve high speed and with some other advantages.

In parallel transmission n bits are transfered simultaneously, hence we have to process each bit separately and line up them in an order at the receiver. Hence we have to convert parallel to serial form. This is known as overhead in parallel transmission.

Signal skewing is the another problem with parallel data transmission. In the parallel communication, n bits leave at a time, but may not be received at the receiver at the same time, some may reach late than others. To overcome this problem, receiving end has to synchronize with the transmitter and must wait until all the bits are received. The greater the skew the greater the delay, if delay is increased that effects the speed.

Another problem associated with parallel transmission is crosstalk. Wh…

Digital Design Interview Questions - 4

1. Design 2 input AND, OR, and EXOR gates using 2 input NAND gate.

2. Design a circuit which doubles the frequency of a given input clock signal.

3. Implement a D-latch using 2x1 multiplexer(s).

4. Give the excitation table of a JK flip-flop.

5. Give the Binary, Hexadecimal, BCD, and Excess-3 code for decimal 14.

Binary: 1110
Hexadecimal: E
BCD: 0001 0100
Excess-3: 10001

6. What is race condition?

7. Give 1's and 2's complement of 19.

19: 10011
1's complement: 01100
2's complement: 01101

8. Design a 3:6 decoder.

9. If A*B=C and C*A=B then, what is the Boolean operator * ?

* is Exclusive-OR.

10. Design a 3 bit Gray Counter.

Verilog Interview Questions - 3

1. How are blocking and non-blocking statements executed?

In a blocking statement, the RHS will be evaluated and the LHS will be then updated, without interruption from any other Verilog statement. A blocking statement "blocks" trailing statements.
In a non-blocking statement, RHS will be evaluated at the beginning of the time step. Then the LHS will be updated at the end of the time step.

2. How do you model a synchronous and asynchronous reset in Verilog?

Synchronous reset:
always @(posedge clk)

Asynchronous reset:
always @(posedge clk or posedge reset)
The logic is very simple: In asynchronous reset, the always block will invoked at positive edge of the reset signal, irrespective of clock's value.

3. What happens if there is connecting wires width mismatch?

For example there are two signals rhs[7:0], and lhs[15:0]. If we do rhs = lhs. Then it is equivalent to rhs = lhs[7:0]. Assignment starts from LSBs of the signals,…

VLSI Interview Questions - 5

This sections contains interview questions related to LOW POWER VLSI DESIGN.

1. What are the important aspects of VLSI optimization?

Power, Area, and Speed.
2. What are the sources of power dissipation?

+ Dynamic power consumption, due to logic transitions causing logic gates to charge/discharge load capacitance.
+ Short-circuit current, this occurs when p-tree and n-tree shorted (for a while) during logic transition.
+ Leakage current, this is a very important source of power dissipation in nano technology, it increases with decrease in lambda value. It is caused due to diode leakages around transistors and n-wells.
3. What is the need for power reduction?

Low power increases noise immunity, increases batter life, decreases cooling and packaging costs.
4. Give some low power design techniques.

Voltage scaling, transistor resizing, pipelining and parallelism, power management modes like standby modes, etc.
5. Give a disadvantage of voltage scaling technique fo…

Digital Design Interview Questions - 1

1. How do you convert a XOR gate into a buffer and a inverter (Use only one XOR gate for each)?

2. Implement an 2-input AND gate using a 2x1 mux.

3. What is a multiplexer?

A multiplexer is a combinational circuit which selects one of many input signals and directs to the only output.

4. What is a ring counter?

A ring counter is a type of counter composed of a circular shift register. The output of the last shift register is fed to the input of the first register. For example, in a 4-register counter, with initial register values of 1100, the repeating pattern is: 1100, 0110, 0011, 1001, 1100, so on.

5. Compare and Contrast Synchronous and Asynchronous reset.

Synchronous reset logic will synthesize to smaller flip-flops, particularly if the reset is gated with the logic generating the d-input. But in such a case, the combinational logic gate count grows, so the overall gate count savings may not be that significant. The clock works as a filter for small reset gl…