SlideShare a Scribd company logo
1 of 25
Download to read offline
1
2. Combinational and Sequential Circuits Design
2.1. Combinational Logic
A combinational system (device) is a digital system in which
the value of the output at any instant depends only on the value
of the input at that same instant (and not on previous values).
High-Level Specification of Combinational Systems
The specification consists of the following three components:
The set of values for the input, called the input set;
The set of values for the output, called the output set;
The description of the input-output function:
• a table (discrete function)
• an arithmetic expression (elements of the input and output
sets are functions)
• a conditional expression (if the function can be partitioned
into subfanctions)
• a logical expression (Boolen formula, preposition)
• a composition of simpler functions
2
Example
Informal specification: A radix-4 digit comparator module
compares two radix-4 digits and produces one output with
values G (grater), E(equal), and S(smaller).
The high-level specification is:
Inputs: x, y ∈ {0, 1, 2, 3}
Outputs: z ∈ {G, E, S}
Function (a conditional expression):
The tabular description of this function is
y
x 0 1 2 3
0 E S S S
1 G E S S
2 G G E S
3 G G G E
x
z
y
G if x > y
z = E if x = y
S if x < y
G if x > y
z = E if x = y
S if x < y
3
To obtain a binary description we have to code the input and
output values on bit vectors.
x z
y
The three-values output requires at least two binary variables.
We use three binary variables. In this case, there are possible
8*7*6=336 code systems. We choose one of them
At the logic level we must work with both logic expression and
gate networks to find the best implementation of a function,
keeping in mind the relationships:
• combinational logic expressions are the specification;
• logic gate networks are the implementation;
• area (number of gates), delay, and power are the cost
(restrictions).
z z2 z1 z0
G 1 0 0
E 0 1 0
S 0 0 1
For input, we take the most used binary code in which the radix-
4 digit is represented by the correspondingradix-2 bit-vector
( x = 2*x1+x0; y =2 *y1+y0 )
High-level specification
Coding
Binary
specification Decoding
4
x
( y )
x1
( y1 )
x2
( y2 )
1 0 0
2 0 1
3 1 0
4 1 1
Now, we can obtain the switching functions described by the
following table (binary specification of combinational system):
y1 y0
x1 x0 00 01 10 11
00 010 001 001 001
01 100 010 001 001
10 100 100 010 001
11 100 100 100 010
z2 z1 z0
5
Example ONE’S COUNT
A2
C1
A1
A0 C0
entity ONES_CNT is
port (A: in BIT_VECTOR(2 downto 0);
C: out BIT_VECTOR(1 downto 0));
end ONES_CNT;
--Truth table:
------------------------------------
-- A2 A1 A0 C1 C0
------------------------------------
-- 0 0 0 0 0
-- 0 0 1 0 1
-- 0 1 0 0 1
-- 0 1 1 1 0
-- 1 0 0 0 1
-- 1 0 1 1 0
-- 1 1 0 1 0
-- 1 1 1 1 1
-------------------------------------
end ONES_CNT;
architecture PURE_BEHAVIOR of ONES_CNT is
begin
process(A)
variable NUM: INTEGER range 0 to 3;
begin
NUM := 0;
for I in 0 to 2 loop
if A(I) = '1' then
NUM := NUM + 1;
end if;
end loop;
case NUM is
when 0 => C <= '00';
when 1 => C <= '01';
when 2 => C <= '10';
when 3 => C <= '11';
end case;
end process;
end PURE_BEHAVIOR;
ONES_CNT
6
A1 A0
00 01 11 10
A2 0 0 0 1 0
1 0 1 1 1
C1 = A1 A0 ∨∨ A2 A0 ∨∨ A2A1
A1 A0
00 01 11 10
A2 0 0 1 0 1
1 1 0 1 0
C0 = A2A1A0 ∨∨ A2A1A0 ∨∨ A2A1A0 ∨∨ A2A1A0
C1 is the MAJORITY FUNCTION
C0 is ODD-PARITY FUNCTION
7
--Macro-based architectural body:
architecture MACRO of ONES_CNT is
begin
C(1) <= MAJ3(A);
C(0) <= OPAR3(A);
end MACRO;
This architectural body implies the existence of MAJ and
OPAR gates at the hardware level. In terms of a VHDL description,
it requires that the functions MAJ3 and OPAR3 must have been
declared and defined previously.
architecture DATA_FLOW of ONES_CNT is
begin
C(1) <= (A(1) and A(0)) or (A(2) and A(0)) or (A(2)
and A(1));
C(0) <= (A(2) and not A(1) and not A(0)) or
(not A(2) and not A(1) and A(0)) or
(A(2) and A(1) and A(0)) or
(not A(2) and A(1) and not A(0))
end DATA_FLOW;
Structural Design Hierarchy for the Ones Counter (ONES_CNT)
Structural
Decomposition
Behavioral
Modeling
ONES_CNT
MAJ3 OPAR3
AND2 OR3 AND3 OR4
8
Majority Function Gate Structure
X(0) A1
X(1)
X(0) A2
X(2) Z
X(1) A3
X(2)
entity AND2 is
port (I1, I2:in BIT; O out BIT);
end AND2
architecture BEHAVIOR of AND2 is
begin
O <= I1 and I2;
end BEHAVIOR;
AND2
AND2
AND2
OR3
9
entity OR3 is
port(I1, I2, I3: BIT; O: out BIT);
end OR3;
architecture BEHAVIOR of OR3 is
begin
O <= I1 or I2 or I3;
end BEHAVIOR;
use work.all;
entity MAJ3 is
port(X: in BIT_VECTOR(2 downto 0); Z: out BIT);
end MAJ3;
architecture AND_OR of MAJ3 is
component AND2C
port (I1, I2: in BIT; O: out BIT);
end component;
component OR3C
port (I1, I2, I3: in BIT; O: out BIT);
end component
for all: AND2C use entity AND2(BEHAVIOR);
for all: OR3C use entity OR3(BEHAVIOR);
signal A1, A2, A3: BIT;
begin
G1: AND2C
port map (X(0), X(1), A1);
G2: AND2C
port map (X(0), X(2), A2);
G3: AND2C
port map (X(1), X(2), A3;
G4: OR3C
port map (A1, A2, A3, Z);
end AND_OR;
10
use work.all;
architecture STRUCTURAL of ONES_CNT is
component MAJ3C
port (X: in BIT_VECTOR(2 downto 0);
Z: out BIT);
end component;
component OPAR3C
port (X: in BIT_VECTOR(2 downto 0);
Z: out BIT);
end component;
for all: MAJ3C use entity MAJ3 (AND_OR);
for all: OPAR3C use entity OPAR3C (AND_OR);
begin
COMP1: MAJ3C
port map (A, C(1));
COMP2: OPAR3C
port map (A, C(0));
end STRUCTURAL;
Structural Architectural Body for the Ones Counter.
MODELING STYLES
VHDL Architectural Body
Behavioral Structural
Algorithmic Data Flow
11
2.2. Sequential Logic
A sequential circuit is a circuit with memory. A Finite State
Machine (FSM) is a mathematical model of a system with
discrete inputs, discrete outputs and a finite number of internal
configurations or states. The state of a system completely
summarizes the information concerning the past inputs to the
system that is needed to determine its behavior on subsequent
inputs.
This high-level FSM model has only one input channel and only
one output channel. Variables in the specification of a design are
multiple-valued or symbolic. The symbolic variable takes on
symbolic values.
x y
Clk
A sequential circuit is said to be synchronous if the internal state
of the machine changes at specific instants of of time as
governed by a clock.
Circuits with an acyclic underlying topology are combinational.
Feedback (cyclic) is a necessary condition for a circuit to be
sequential.
12
FSM as algebraic system is a quintuple A = 〈 S, I, O, δ, λ 〉,
where
S is a finite non-empty set of states,
I is a finite non-empty set of inputs and
O is a finite set of outputs.
δ: I × S → S is called transition (or next state function) and
λ is called the output function of A
λ: I × S → O for Mealy type FSM,
λ: S → O for a Moore machine,.
Note that any Moore machine can be converted into a Mealy
machine with the same number of states and state transitions.
A general logic-level synchronous sequential circuit
Primary Primary
Inputs Outputs
Present Next
States States
Logic-level description consists of a combinational logic block
and state registers (latches or flip-flops) that hold the state
information.
The combinational block is an interconnection of gates that
implements the mapping between the primary input (PI) and
present-state (PS), and primary output (PO) and next-state (NS).
A state is a bit vector of length equal to the number of memory
elements (latches or flip-flops) in the sequential circuit. Each
state has a unique bit vector representing that state, and this bit
vector is known as the state code. The process of assigning a
code to each state is known as state assignment or state
encoding.
Combinational
Logic
Latches
(Flip-flops)
13
Example represetatations of the device which ditects two or
more consecutive 1's or two consecutive 0' on its input X.
X
R Z
CLK
Block Diagram
R
0 / 0 1 / 0
0 / 0
0 / 1 1 / 1
State Diagram 1 / 0
CLK
X
Z
Timing Diaram
TWO_CON
S0
S1 S2
14
state X
0 1
S0 S1 / 0 S2 / 0
S1 S1 / 1 S2 / 0
S2 S1 / 0 S2 / 0
State Table
code
state y1y0
S0 00
S1 01
S2 11
State Assignment
Xcode
y1 y0 0 1
00 0 1
01 0 1
11 0 1
10 - -
Truth Table (K-map)
Y1
Xcode
y1 y0 0 1
00 1 1
01 1 1
11 1 1
10 - -
Truth Table (K-map)
Y0
Xcode
y1 y0 0 1
00 0 0
01 1 0
11 0 1
10 - -
Truth Table (K-map) Z
15
2.3. Multilevel Design of Sequential Logic Circuits.
Design a serial to parallel converter.
R
4
A Z
D DONE
CLK
A word description of an example device:
Reset signal R is synchronous. If R = 1 at the end of any clock period, the
device must enter the reset state.
Input A will be asserted for exactly one clock period prior to the arrival
of serial data on input D.
For the next four clock periods, data will arrive serially on line D.
The device must collect the 4 bits of serial data and output the 4 bits in
parallel at output Z, which is a 4-bit vector.
During the clock period when the parallel data is present at Z, signal
DONE will be asserted. The outputs Z and DONE must remain asserted
for one full clock period.
DONE alerts the destination device that data is present on Z.
CLK
R
A
D
DONE
Z [4]
STOP
16
Design process:
1. A word description for a device.
2. Moore or Mealy decision:
The State Transition Graph (STG) or state diagram of the Moore
machine has the output associated with the states, while in the Mealy
model, the outputs are associated with the edges.
• A Moore machine may require more states than the
corresponding Mealy machine.
• Moore device isolates the outputs from the inputs
• Mealy machine can respond one clock period one clock period
earlier than the Moore machine to input changes, but noise on
the input lines may be transferred to the outputs.
For the several to parallel converter (STOP), the output must
be present during the clock period following the last input. Since the last
input is no longer available, the outputs cannot depend on the inputs.
Also, since the outputs are specified to be constant during the entire clock
period, a Mealy machine cannot be used. Therefore we must design a
Moore machine.
3. Construction of a state table.
We follow the structured methodology.
Two techniques:
a) state diagrams
b) transition lists
3.1. Creating a state diagram (STG)
To construct a state diagram, start with a state that is easily
described in words. If there is a reset state, that is always a very good
place to start.
We recommend writing a complete word description of each
state as it is created.
The process is iterative in nature.
17
State S0: The Reset State.
The device enters this state at the end of any clock period in which input
R=1 regardless of the values of any input. The device will stay in this
state until there is a logic 1 on line A.
When in state S0, DONE = 0which means that the data on line Z will be
ignored by the destination. This means that we are free to place anything
at all on output Z.
The next step is to decide what to do when device is in state S0 for
various conditions that may exist on the device inputs. If the device is in
state S0, it will stay in S0 if R=1 regardless of the values of any other
input. When R=0, the device also will stay in state S0 when A=0. The
complete condition for the device to state in state S0 is
R ∨ (¬R&¬A) = R ∨ ¬A
If R = 0 and A = 1 during some clock period, then the device must get
ready to receive data on line D during the next 4 clock periods. This
means that it must enter a new state at the end of clock period.
State S1.
The device enters this state from state S0 when R = 0 and A = 1.
When the device is in state S1 the first data value will be present on line
D and must be saved at the end of clock period for later output.
When in state S1, output DONE = 0 and Z is unspecified.
¬R & A
R ∨ ¬A
S1
0-
S0
0-
18
State S2.
State S1 transitions to state S2 when R = 0.
When in state S2, the second data value will be present on line D and
must be saved at the end of clock period.
In state S2, the output DONE = 0 and Z is unspecified.
Therefore, a new node is added to the state diagram under construction
for state S2. An arc from S1 to S2 with label ¬R indicates the desired
state transition.
¬R
R
¬R & A
R ∨ ¬A
S2
0-
S1
0-
S0
0-
19
This figure shows the final state diagram (STG) for device STOP.
¬R
¬R
¬R R R R ¬R
R
¬R&A R ∨ ¬A
R ∨ ¬A
¬R&A
Final state diagram for serial to parallel converter
S2
0-
S1
0-
S0
0-
S5
1Z
S4
0-
S3
0-
20
3.2. Transition List Approach
Present Transition Next Data Output
state Expression State Transfers
S0 R ∨ ¬A S0 None DONE =0
S0 ¬R & A S1 Z unspec.
S1 ¬R S2 Store bit 1 DONE = 0
S1 R S0 Z unspec.
S2 ¬R S3 Store bit 2 DONE = 0,
S2 R S0 Z unspec.
S3 ¬R S4 Store bit 3 DONE = 0,
S3 R S0 Z unspec.
S4 ¬R S5 Store bit 4 DONE = 0
S4 R S0 Z unspec.
S5 ¬R & A S1 None DONE = 1,
Z = paral. data out
S5 R ∨ ¬A S0
Principle of Mutual Exclusion.
No two expressions on different arcs can be true simultaneously.
For example for node S0,
(¬R & A)&( R ∨ ¬A) = ¬RAR ∨ ¬RA¬A = 0
21
entity STOP is
port (R, A, D, CLK: in BIT;
Z: out BIT_VECTOR (3 downto 0);
DONE: out BIT);
end STOP;
architecture FSM_RTL of STOP is
type STATE_TYPE is (S0, S1, S2, S3, S4, S5);
signal STATE: STATE_TYPE;
signal SHIFT_REG: BIT_VECTOR (3 downto 0);
begin
STATE: process (CLK)
begin
if CLK = ‘1’ then
case STATE is
when S0 =>
if R = ‘1’ or A = ‘0’ then
STATE <= S0;
elsif R = ‘0’ and A = ‘1’ then
STATE <= S1;
end if;
when S1 =>
SHIFT_REG <= D & SHIFT_REG(3 downto 1);
if R = ‘0’ then
STATE <= S2;
elsif R = ‘1’ then
STATE <= S0;
end if;
when S2 =>
SHIFT_REG <= D & SHIFT_REG (3 downto 1);
if R = ‘0’ then
STATE <= S3;
elsif R = ‘1’ then
STATE <= S0;
end if;
22
when S3 =>
SHIFT_REG <= D & SHIFT_REG (3 downto1);
if R = ‘0’ then
STATE <= S4;
elsif R = ‘1’ then
STATE <=S0;
end if;
when S4 =>
SHIFT_REG <= D & SHIFT_REG (3 downto1);
if R = ‘0’ then
STATE <= S5;
elsif R = ‘1’ then
STATE <=S0;
end if;
when S5 =>
if R = ‘0’ and A =’1’ then
STATE <= S1;
elsif R = ‘1’ or A = ‘0’ then
STATE <= S0;
end if;
end case;
end if;
end process STATE;
OUTPUT: process (STATE)
begin
case STATE is
when S0 to S4 =>
DONE <= ‘0’;
when S5 =>
DONE <= ‘1’;
Z <= SHIFT_REG;
end case;
end process OUTPUT;
end FSM_RTL;
23
I
Z
CLK
Block diagram for model of a state machine.
Control circuit synthesized from VHDL description (serial to parallel
converter)
TO FROM CONDITION
STATE STATE
S0 S0 R + ¬A
S0 S1 R
S0 S2 R
S0 S3 R
S0 S4 R
S0 S5 R + ¬A
S1 S0 ¬R A
S1 S5 ¬R A
S2 S1 ¬R
S3 S2 ¬R
S4 S3 ¬R
S5 S4 R
Data Unit
Control
Unit
Output
Unit
24
Control section synthesis list for serial to parallel converter.
One-hot coding stile
S0 S0
S5 ¬R
A
R
¬A
R ¬R
S1 A
S2
S3 S5
S4
S2 S3 S4
S1
¬R ¬R ¬R ¬R
1
1
1
&
&
1
D Q
¬Q
1
&
&
D Q
¬Q
&
D Q
¬Q
& D Q
¬Q
D Q
¬Q
D Q
¬Q
& &
S5
S1
25
Synthesis list for data unit for serial to parallel converter.
Data Transfer State Condition
SHIFT_REG <= D & SHIFT_REG (3 downto 1) S1 1
SHIFT_REG <= D & SHIFT_REG (3 downto 1) S2 1
SHIFT_REG <= D & SHIFT_REG (3 downto 1) S3 1
SHIFT_REG <= D & SHIFT_REG (3 downto 1) S4 1
Data unit for serial to parallel converter.
SHIFT_REG(3)
SHIFT_REG(2)
SHIFT_REG(1)
SHIFT_REG(0)
D
S1
S2
S3
S4
SHIFT = S1+S2+S3+S4
The output unit
DONE = S5
Z = SHIFT_REG
D3 D2 D1 D0
S1
SHIFT REGISTER
SH

More Related Content

What's hot

Demultiplexer with vhdl code
Demultiplexer  with vhdl codeDemultiplexer  with vhdl code
Demultiplexer with vhdl codeVishal Bait
 
Computer organization and architecture lab manual
Computer organization and architecture lab manual Computer organization and architecture lab manual
Computer organization and architecture lab manual Shankar Gangaju
 
Digital Electronics (EC8392) UNIT-II -PPT-S.SESHA VIDHYA/ ASP/ECE
Digital Electronics (EC8392) UNIT-II -PPT-S.SESHA VIDHYA/ ASP/ECEDigital Electronics (EC8392) UNIT-II -PPT-S.SESHA VIDHYA/ ASP/ECE
Digital Electronics (EC8392) UNIT-II -PPT-S.SESHA VIDHYA/ ASP/ECESeshaVidhyaS
 
Lecture 2 verilog
Lecture 2   verilogLecture 2   verilog
Lecture 2 verilogvenravi10
 
SEQUENTIAL AND COMBINATIONAL CIRCUITS,DIGITAL LOGIC DESIGN
SEQUENTIAL AND COMBINATIONAL CIRCUITS,DIGITAL LOGIC DESIGNSEQUENTIAL AND COMBINATIONAL CIRCUITS,DIGITAL LOGIC DESIGN
SEQUENTIAL AND COMBINATIONAL CIRCUITS,DIGITAL LOGIC DESIGNQAU ISLAMABAD,PAKISTAN
 
Design of Multiplexers, Decoder and a Full Subtractor using Reversible Gates
Design of Multiplexers, Decoder and a Full Subtractor using Reversible GatesDesign of Multiplexers, Decoder and a Full Subtractor using Reversible Gates
Design of Multiplexers, Decoder and a Full Subtractor using Reversible GatesIJLT EMAS
 
Combinational Circuits & Sequential Circuits
Combinational Circuits & Sequential CircuitsCombinational Circuits & Sequential Circuits
Combinational Circuits & Sequential Circuitsgourav kottawar
 
Verilog VHDL code Decoder and Encoder
Verilog VHDL code Decoder and EncoderVerilog VHDL code Decoder and Encoder
Verilog VHDL code Decoder and EncoderBharti Airtel Ltd.
 
Digital Logic & Design (DLD) presentation
Digital Logic & Design (DLD) presentationDigital Logic & Design (DLD) presentation
Digital Logic & Design (DLD) presentationfoyez ahammad
 
catalyst switch Operation
catalyst switch Operationcatalyst switch Operation
catalyst switch Operationscooby_doo
 
Computer architecture
Computer architectureComputer architecture
Computer architecturevishnu973656
 
Digital logic gates
Digital logic gatesDigital logic gates
Digital logic gatesjsearle11
 
Lec9 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Com...
Lec9 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Com...Lec9 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Com...
Lec9 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Com...Hsien-Hsin Sean Lee, Ph.D.
 

What's hot (20)

Demultiplexer with vhdl code
Demultiplexer  with vhdl codeDemultiplexer  with vhdl code
Demultiplexer with vhdl code
 
Digital Logic circuit
Digital Logic circuitDigital Logic circuit
Digital Logic circuit
 
Computer organization and architecture lab manual
Computer organization and architecture lab manual Computer organization and architecture lab manual
Computer organization and architecture lab manual
 
Ec1201
Ec1201Ec1201
Ec1201
 
Digital Electronics (EC8392) UNIT-II -PPT-S.SESHA VIDHYA/ ASP/ECE
Digital Electronics (EC8392) UNIT-II -PPT-S.SESHA VIDHYA/ ASP/ECEDigital Electronics (EC8392) UNIT-II -PPT-S.SESHA VIDHYA/ ASP/ECE
Digital Electronics (EC8392) UNIT-II -PPT-S.SESHA VIDHYA/ ASP/ECE
 
Lecture 2 verilog
Lecture 2   verilogLecture 2   verilog
Lecture 2 verilog
 
SEQUENTIAL AND COMBINATIONAL CIRCUITS,DIGITAL LOGIC DESIGN
SEQUENTIAL AND COMBINATIONAL CIRCUITS,DIGITAL LOGIC DESIGNSEQUENTIAL AND COMBINATIONAL CIRCUITS,DIGITAL LOGIC DESIGN
SEQUENTIAL AND COMBINATIONAL CIRCUITS,DIGITAL LOGIC DESIGN
 
Design of Multiplexers, Decoder and a Full Subtractor using Reversible Gates
Design of Multiplexers, Decoder and a Full Subtractor using Reversible GatesDesign of Multiplexers, Decoder and a Full Subtractor using Reversible Gates
Design of Multiplexers, Decoder and a Full Subtractor using Reversible Gates
 
Combinational Circuits & Sequential Circuits
Combinational Circuits & Sequential CircuitsCombinational Circuits & Sequential Circuits
Combinational Circuits & Sequential Circuits
 
Logic gate
Logic gateLogic gate
Logic gate
 
EE8351 DLC
EE8351 DLCEE8351 DLC
EE8351 DLC
 
Logic gates presentation
Logic gates presentationLogic gates presentation
Logic gates presentation
 
Verilog VHDL code Decoder and Encoder
Verilog VHDL code Decoder and EncoderVerilog VHDL code Decoder and Encoder
Verilog VHDL code Decoder and Encoder
 
Coding verilog
Coding verilogCoding verilog
Coding verilog
 
Digital Logic & Design (DLD) presentation
Digital Logic & Design (DLD) presentationDigital Logic & Design (DLD) presentation
Digital Logic & Design (DLD) presentation
 
catalyst switch Operation
catalyst switch Operationcatalyst switch Operation
catalyst switch Operation
 
e CAD lab manual
e CAD lab manuale CAD lab manual
e CAD lab manual
 
Computer architecture
Computer architectureComputer architecture
Computer architecture
 
Digital logic gates
Digital logic gatesDigital logic gates
Digital logic gates
 
Lec9 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Com...
Lec9 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Com...Lec9 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Com...
Lec9 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Com...
 

Similar to Combinational logic circuit by umakant bhaskar gohatre

Hardware Description Language
Hardware Description Language Hardware Description Language
Hardware Description Language Prachi Pandey
 
Sequential and combinational alu
Sequential and combinational alu Sequential and combinational alu
Sequential and combinational alu Piyush Rochwani
 
Design System Design-ASM and Asynchronous Sequential Circuits
Design System Design-ASM and Asynchronous Sequential CircuitsDesign System Design-ASM and Asynchronous Sequential Circuits
Design System Design-ASM and Asynchronous Sequential CircuitsIndira Priyadarshini
 
Programmable Logic Array(PLA), digital circuits
Programmable Logic Array(PLA), digital circuits Programmable Logic Array(PLA), digital circuits
Programmable Logic Array(PLA), digital circuits warda aziz
 
Programmable array-logic-and-programmable-logic-array
Programmable array-logic-and-programmable-logic-arrayProgrammable array-logic-and-programmable-logic-array
Programmable array-logic-and-programmable-logic-arrayJher Carlson Atasan
 
407841208-Modular-UART.pptx design and architecture
407841208-Modular-UART.pptx design and architecture407841208-Modular-UART.pptx design and architecture
407841208-Modular-UART.pptx design and architecturePallaviBR4UB20EI021
 
Digital logic-formula-notes-final-1
Digital logic-formula-notes-final-1Digital logic-formula-notes-final-1
Digital logic-formula-notes-final-1Kshitij Singh
 
Digital logic and microprocessors
Digital logic and microprocessorsDigital logic and microprocessors
Digital logic and microprocessorsMilind Pelagade
 
Introduction to VHDL
Introduction to VHDLIntroduction to VHDL
Introduction to VHDLYaser Kalifa
 
Sequential Circuits-ppt_2.pdf
Sequential Circuits-ppt_2.pdfSequential Circuits-ppt_2.pdf
Sequential Circuits-ppt_2.pdfimadshaheen2
 
N byte error detecting and correcting code using reedsolomon
N byte error detecting and correcting code using reedsolomonN byte error detecting and correcting code using reedsolomon
N byte error detecting and correcting code using reedsolomoneSAT Publishing House
 
N byte error detecting and correcting code using reed-solomon and cellular au...
N byte error detecting and correcting code using reed-solomon and cellular au...N byte error detecting and correcting code using reed-solomon and cellular au...
N byte error detecting and correcting code using reed-solomon and cellular au...eSAT Journals
 
8251 usart programmable communication interface by aniket bhute
8251  usart  programmable communication interface by aniket bhute8251  usart  programmable communication interface by aniket bhute
8251 usart programmable communication interface by aniket bhuteAniket Bhute
 
CH3_Gate Level Minimization.pdf
CH3_Gate Level Minimization.pdfCH3_Gate Level Minimization.pdf
CH3_Gate Level Minimization.pdfSanjoySana2
 

Similar to Combinational logic circuit by umakant bhaskar gohatre (20)

Hardware Description Language
Hardware Description Language Hardware Description Language
Hardware Description Language
 
Sequential and combinational alu
Sequential and combinational alu Sequential and combinational alu
Sequential and combinational alu
 
slide8.ppt
slide8.pptslide8.ppt
slide8.ppt
 
Design System Design-ASM and Asynchronous Sequential Circuits
Design System Design-ASM and Asynchronous Sequential CircuitsDesign System Design-ASM and Asynchronous Sequential Circuits
Design System Design-ASM and Asynchronous Sequential Circuits
 
Programmable Logic Array(PLA), digital circuits
Programmable Logic Array(PLA), digital circuits Programmable Logic Array(PLA), digital circuits
Programmable Logic Array(PLA), digital circuits
 
Programmable array-logic-and-programmable-logic-array
Programmable array-logic-and-programmable-logic-arrayProgrammable array-logic-and-programmable-logic-array
Programmable array-logic-and-programmable-logic-array
 
407841208-Modular-UART.pptx design and architecture
407841208-Modular-UART.pptx design and architecture407841208-Modular-UART.pptx design and architecture
407841208-Modular-UART.pptx design and architecture
 
Digital logic-formula-notes-final-1
Digital logic-formula-notes-final-1Digital logic-formula-notes-final-1
Digital logic-formula-notes-final-1
 
ppt.pptx
ppt.pptxppt.pptx
ppt.pptx
 
Digital logic and microprocessors
Digital logic and microprocessorsDigital logic and microprocessors
Digital logic and microprocessors
 
Uart
UartUart
Uart
 
Combinational circuits
Combinational circuitsCombinational circuits
Combinational circuits
 
Introduction to VHDL
Introduction to VHDLIntroduction to VHDL
Introduction to VHDL
 
Convolutional codes
Convolutional codesConvolutional codes
Convolutional codes
 
Sequential Circuits-ppt_2.pdf
Sequential Circuits-ppt_2.pdfSequential Circuits-ppt_2.pdf
Sequential Circuits-ppt_2.pdf
 
COA pptx.pptx
COA pptx.pptxCOA pptx.pptx
COA pptx.pptx
 
N byte error detecting and correcting code using reedsolomon
N byte error detecting and correcting code using reedsolomonN byte error detecting and correcting code using reedsolomon
N byte error detecting and correcting code using reedsolomon
 
N byte error detecting and correcting code using reed-solomon and cellular au...
N byte error detecting and correcting code using reed-solomon and cellular au...N byte error detecting and correcting code using reed-solomon and cellular au...
N byte error detecting and correcting code using reed-solomon and cellular au...
 
8251 usart programmable communication interface by aniket bhute
8251  usart  programmable communication interface by aniket bhute8251  usart  programmable communication interface by aniket bhute
8251 usart programmable communication interface by aniket bhute
 
CH3_Gate Level Minimization.pdf
CH3_Gate Level Minimization.pdfCH3_Gate Level Minimization.pdf
CH3_Gate Level Minimization.pdf
 

More from Smt. Indira Gandhi College of Engineering, Navi Mumbai, Mumbai

More from Smt. Indira Gandhi College of Engineering, Navi Mumbai, Mumbai (20)

Artificial Intelligence (AI) application in Agriculture Area
Artificial Intelligence (AI) application in Agriculture Area Artificial Intelligence (AI) application in Agriculture Area
Artificial Intelligence (AI) application in Agriculture Area
 
VLSI Design Book CMOS_Circuit_Design__Layout__and_Simulation
VLSI Design Book CMOS_Circuit_Design__Layout__and_SimulationVLSI Design Book CMOS_Circuit_Design__Layout__and_Simulation
VLSI Design Book CMOS_Circuit_Design__Layout__and_Simulation
 
Question Bank: Network Management in Telecommunication
Question Bank: Network Management in TelecommunicationQuestion Bank: Network Management in Telecommunication
Question Bank: Network Management in Telecommunication
 
INTRODUCTION TO CYBER LAW The Concept of Cyberspace Cyber law Cyber crime.pdf
INTRODUCTION TO CYBER LAW The Concept of Cyberspace Cyber law Cyber crime.pdfINTRODUCTION TO CYBER LAW The Concept of Cyberspace Cyber law Cyber crime.pdf
INTRODUCTION TO CYBER LAW The Concept of Cyberspace Cyber law Cyber crime.pdf
 
LRU_Replacement-Policy.pdf
LRU_Replacement-Policy.pdfLRU_Replacement-Policy.pdf
LRU_Replacement-Policy.pdf
 
Network Management Principles and Practice - 2nd Edition (2010)_2.pdf
Network Management Principles and Practice - 2nd Edition (2010)_2.pdfNetwork Management Principles and Practice - 2nd Edition (2010)_2.pdf
Network Management Principles and Practice - 2nd Edition (2010)_2.pdf
 
Euler Method Details
Euler Method Details Euler Method Details
Euler Method Details
 
Mini Project fo BE Engineering students
Mini Project fo BE Engineering  students  Mini Project fo BE Engineering  students
Mini Project fo BE Engineering students
 
Mini Project for Engineering Students BE or Btech Engineering students
Mini Project for Engineering Students BE or Btech Engineering students Mini Project for Engineering Students BE or Btech Engineering students
Mini Project for Engineering Students BE or Btech Engineering students
 
Ballistics Detsils
Ballistics Detsils Ballistics Detsils
Ballistics Detsils
 
VLSI Design_LAB MANUAL By Umakant Gohatre
VLSI Design_LAB MANUAL By Umakant GohatreVLSI Design_LAB MANUAL By Umakant Gohatre
VLSI Design_LAB MANUAL By Umakant Gohatre
 
Cryptography and Network Security
Cryptography and Network SecurityCryptography and Network Security
Cryptography and Network Security
 
cyber crime, Cyber Security, Introduction, Umakant Bhaskar Gohatre
cyber crime, Cyber Security, Introduction, Umakant Bhaskar Gohatre cyber crime, Cyber Security, Introduction, Umakant Bhaskar Gohatre
cyber crime, Cyber Security, Introduction, Umakant Bhaskar Gohatre
 
Image Compression, Introduction Data Compression/ Data compression, modelling...
Image Compression, Introduction Data Compression/ Data compression, modelling...Image Compression, Introduction Data Compression/ Data compression, modelling...
Image Compression, Introduction Data Compression/ Data compression, modelling...
 
Introduction Data Compression/ Data compression, modelling and coding,Image C...
Introduction Data Compression/ Data compression, modelling and coding,Image C...Introduction Data Compression/ Data compression, modelling and coding,Image C...
Introduction Data Compression/ Data compression, modelling and coding,Image C...
 
Python overview
Python overviewPython overview
Python overview
 
Python numbers
Python numbersPython numbers
Python numbers
 
Python networking
Python networkingPython networking
Python networking
 
Python multithreading
Python multithreadingPython multithreading
Python multithreading
 
Python modules
Python modulesPython modules
Python modules
 

Recently uploaded

costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsAndrey Dotsenko
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 

Recently uploaded (20)

costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 

Combinational logic circuit by umakant bhaskar gohatre

  • 1. 1 2. Combinational and Sequential Circuits Design 2.1. Combinational Logic A combinational system (device) is a digital system in which the value of the output at any instant depends only on the value of the input at that same instant (and not on previous values). High-Level Specification of Combinational Systems The specification consists of the following three components: The set of values for the input, called the input set; The set of values for the output, called the output set; The description of the input-output function: • a table (discrete function) • an arithmetic expression (elements of the input and output sets are functions) • a conditional expression (if the function can be partitioned into subfanctions) • a logical expression (Boolen formula, preposition) • a composition of simpler functions
  • 2. 2 Example Informal specification: A radix-4 digit comparator module compares two radix-4 digits and produces one output with values G (grater), E(equal), and S(smaller). The high-level specification is: Inputs: x, y ∈ {0, 1, 2, 3} Outputs: z ∈ {G, E, S} Function (a conditional expression): The tabular description of this function is y x 0 1 2 3 0 E S S S 1 G E S S 2 G G E S 3 G G G E x z y G if x > y z = E if x = y S if x < y G if x > y z = E if x = y S if x < y
  • 3. 3 To obtain a binary description we have to code the input and output values on bit vectors. x z y The three-values output requires at least two binary variables. We use three binary variables. In this case, there are possible 8*7*6=336 code systems. We choose one of them At the logic level we must work with both logic expression and gate networks to find the best implementation of a function, keeping in mind the relationships: • combinational logic expressions are the specification; • logic gate networks are the implementation; • area (number of gates), delay, and power are the cost (restrictions). z z2 z1 z0 G 1 0 0 E 0 1 0 S 0 0 1 For input, we take the most used binary code in which the radix- 4 digit is represented by the correspondingradix-2 bit-vector ( x = 2*x1+x0; y =2 *y1+y0 ) High-level specification Coding Binary specification Decoding
  • 4. 4 x ( y ) x1 ( y1 ) x2 ( y2 ) 1 0 0 2 0 1 3 1 0 4 1 1 Now, we can obtain the switching functions described by the following table (binary specification of combinational system): y1 y0 x1 x0 00 01 10 11 00 010 001 001 001 01 100 010 001 001 10 100 100 010 001 11 100 100 100 010 z2 z1 z0
  • 5. 5 Example ONE’S COUNT A2 C1 A1 A0 C0 entity ONES_CNT is port (A: in BIT_VECTOR(2 downto 0); C: out BIT_VECTOR(1 downto 0)); end ONES_CNT; --Truth table: ------------------------------------ -- A2 A1 A0 C1 C0 ------------------------------------ -- 0 0 0 0 0 -- 0 0 1 0 1 -- 0 1 0 0 1 -- 0 1 1 1 0 -- 1 0 0 0 1 -- 1 0 1 1 0 -- 1 1 0 1 0 -- 1 1 1 1 1 ------------------------------------- end ONES_CNT; architecture PURE_BEHAVIOR of ONES_CNT is begin process(A) variable NUM: INTEGER range 0 to 3; begin NUM := 0; for I in 0 to 2 loop if A(I) = '1' then NUM := NUM + 1; end if; end loop; case NUM is when 0 => C <= '00'; when 1 => C <= '01'; when 2 => C <= '10'; when 3 => C <= '11'; end case; end process; end PURE_BEHAVIOR; ONES_CNT
  • 6. 6 A1 A0 00 01 11 10 A2 0 0 0 1 0 1 0 1 1 1 C1 = A1 A0 ∨∨ A2 A0 ∨∨ A2A1 A1 A0 00 01 11 10 A2 0 0 1 0 1 1 1 0 1 0 C0 = A2A1A0 ∨∨ A2A1A0 ∨∨ A2A1A0 ∨∨ A2A1A0 C1 is the MAJORITY FUNCTION C0 is ODD-PARITY FUNCTION
  • 7. 7 --Macro-based architectural body: architecture MACRO of ONES_CNT is begin C(1) <= MAJ3(A); C(0) <= OPAR3(A); end MACRO; This architectural body implies the existence of MAJ and OPAR gates at the hardware level. In terms of a VHDL description, it requires that the functions MAJ3 and OPAR3 must have been declared and defined previously. architecture DATA_FLOW of ONES_CNT is begin C(1) <= (A(1) and A(0)) or (A(2) and A(0)) or (A(2) and A(1)); C(0) <= (A(2) and not A(1) and not A(0)) or (not A(2) and not A(1) and A(0)) or (A(2) and A(1) and A(0)) or (not A(2) and A(1) and not A(0)) end DATA_FLOW; Structural Design Hierarchy for the Ones Counter (ONES_CNT) Structural Decomposition Behavioral Modeling ONES_CNT MAJ3 OPAR3 AND2 OR3 AND3 OR4
  • 8. 8 Majority Function Gate Structure X(0) A1 X(1) X(0) A2 X(2) Z X(1) A3 X(2) entity AND2 is port (I1, I2:in BIT; O out BIT); end AND2 architecture BEHAVIOR of AND2 is begin O <= I1 and I2; end BEHAVIOR; AND2 AND2 AND2 OR3
  • 9. 9 entity OR3 is port(I1, I2, I3: BIT; O: out BIT); end OR3; architecture BEHAVIOR of OR3 is begin O <= I1 or I2 or I3; end BEHAVIOR; use work.all; entity MAJ3 is port(X: in BIT_VECTOR(2 downto 0); Z: out BIT); end MAJ3; architecture AND_OR of MAJ3 is component AND2C port (I1, I2: in BIT; O: out BIT); end component; component OR3C port (I1, I2, I3: in BIT; O: out BIT); end component for all: AND2C use entity AND2(BEHAVIOR); for all: OR3C use entity OR3(BEHAVIOR); signal A1, A2, A3: BIT; begin G1: AND2C port map (X(0), X(1), A1); G2: AND2C port map (X(0), X(2), A2); G3: AND2C port map (X(1), X(2), A3; G4: OR3C port map (A1, A2, A3, Z); end AND_OR;
  • 10. 10 use work.all; architecture STRUCTURAL of ONES_CNT is component MAJ3C port (X: in BIT_VECTOR(2 downto 0); Z: out BIT); end component; component OPAR3C port (X: in BIT_VECTOR(2 downto 0); Z: out BIT); end component; for all: MAJ3C use entity MAJ3 (AND_OR); for all: OPAR3C use entity OPAR3C (AND_OR); begin COMP1: MAJ3C port map (A, C(1)); COMP2: OPAR3C port map (A, C(0)); end STRUCTURAL; Structural Architectural Body for the Ones Counter. MODELING STYLES VHDL Architectural Body Behavioral Structural Algorithmic Data Flow
  • 11. 11 2.2. Sequential Logic A sequential circuit is a circuit with memory. A Finite State Machine (FSM) is a mathematical model of a system with discrete inputs, discrete outputs and a finite number of internal configurations or states. The state of a system completely summarizes the information concerning the past inputs to the system that is needed to determine its behavior on subsequent inputs. This high-level FSM model has only one input channel and only one output channel. Variables in the specification of a design are multiple-valued or symbolic. The symbolic variable takes on symbolic values. x y Clk A sequential circuit is said to be synchronous if the internal state of the machine changes at specific instants of of time as governed by a clock. Circuits with an acyclic underlying topology are combinational. Feedback (cyclic) is a necessary condition for a circuit to be sequential.
  • 12. 12 FSM as algebraic system is a quintuple A = 〈 S, I, O, δ, λ 〉, where S is a finite non-empty set of states, I is a finite non-empty set of inputs and O is a finite set of outputs. δ: I × S → S is called transition (or next state function) and λ is called the output function of A λ: I × S → O for Mealy type FSM, λ: S → O for a Moore machine,. Note that any Moore machine can be converted into a Mealy machine with the same number of states and state transitions. A general logic-level synchronous sequential circuit Primary Primary Inputs Outputs Present Next States States Logic-level description consists of a combinational logic block and state registers (latches or flip-flops) that hold the state information. The combinational block is an interconnection of gates that implements the mapping between the primary input (PI) and present-state (PS), and primary output (PO) and next-state (NS). A state is a bit vector of length equal to the number of memory elements (latches or flip-flops) in the sequential circuit. Each state has a unique bit vector representing that state, and this bit vector is known as the state code. The process of assigning a code to each state is known as state assignment or state encoding. Combinational Logic Latches (Flip-flops)
  • 13. 13 Example represetatations of the device which ditects two or more consecutive 1's or two consecutive 0' on its input X. X R Z CLK Block Diagram R 0 / 0 1 / 0 0 / 0 0 / 1 1 / 1 State Diagram 1 / 0 CLK X Z Timing Diaram TWO_CON S0 S1 S2
  • 14. 14 state X 0 1 S0 S1 / 0 S2 / 0 S1 S1 / 1 S2 / 0 S2 S1 / 0 S2 / 0 State Table code state y1y0 S0 00 S1 01 S2 11 State Assignment Xcode y1 y0 0 1 00 0 1 01 0 1 11 0 1 10 - - Truth Table (K-map) Y1 Xcode y1 y0 0 1 00 1 1 01 1 1 11 1 1 10 - - Truth Table (K-map) Y0 Xcode y1 y0 0 1 00 0 0 01 1 0 11 0 1 10 - - Truth Table (K-map) Z
  • 15. 15 2.3. Multilevel Design of Sequential Logic Circuits. Design a serial to parallel converter. R 4 A Z D DONE CLK A word description of an example device: Reset signal R is synchronous. If R = 1 at the end of any clock period, the device must enter the reset state. Input A will be asserted for exactly one clock period prior to the arrival of serial data on input D. For the next four clock periods, data will arrive serially on line D. The device must collect the 4 bits of serial data and output the 4 bits in parallel at output Z, which is a 4-bit vector. During the clock period when the parallel data is present at Z, signal DONE will be asserted. The outputs Z and DONE must remain asserted for one full clock period. DONE alerts the destination device that data is present on Z. CLK R A D DONE Z [4] STOP
  • 16. 16 Design process: 1. A word description for a device. 2. Moore or Mealy decision: The State Transition Graph (STG) or state diagram of the Moore machine has the output associated with the states, while in the Mealy model, the outputs are associated with the edges. • A Moore machine may require more states than the corresponding Mealy machine. • Moore device isolates the outputs from the inputs • Mealy machine can respond one clock period one clock period earlier than the Moore machine to input changes, but noise on the input lines may be transferred to the outputs. For the several to parallel converter (STOP), the output must be present during the clock period following the last input. Since the last input is no longer available, the outputs cannot depend on the inputs. Also, since the outputs are specified to be constant during the entire clock period, a Mealy machine cannot be used. Therefore we must design a Moore machine. 3. Construction of a state table. We follow the structured methodology. Two techniques: a) state diagrams b) transition lists 3.1. Creating a state diagram (STG) To construct a state diagram, start with a state that is easily described in words. If there is a reset state, that is always a very good place to start. We recommend writing a complete word description of each state as it is created. The process is iterative in nature.
  • 17. 17 State S0: The Reset State. The device enters this state at the end of any clock period in which input R=1 regardless of the values of any input. The device will stay in this state until there is a logic 1 on line A. When in state S0, DONE = 0which means that the data on line Z will be ignored by the destination. This means that we are free to place anything at all on output Z. The next step is to decide what to do when device is in state S0 for various conditions that may exist on the device inputs. If the device is in state S0, it will stay in S0 if R=1 regardless of the values of any other input. When R=0, the device also will stay in state S0 when A=0. The complete condition for the device to state in state S0 is R ∨ (¬R&¬A) = R ∨ ¬A If R = 0 and A = 1 during some clock period, then the device must get ready to receive data on line D during the next 4 clock periods. This means that it must enter a new state at the end of clock period. State S1. The device enters this state from state S0 when R = 0 and A = 1. When the device is in state S1 the first data value will be present on line D and must be saved at the end of clock period for later output. When in state S1, output DONE = 0 and Z is unspecified. ¬R & A R ∨ ¬A S1 0- S0 0-
  • 18. 18 State S2. State S1 transitions to state S2 when R = 0. When in state S2, the second data value will be present on line D and must be saved at the end of clock period. In state S2, the output DONE = 0 and Z is unspecified. Therefore, a new node is added to the state diagram under construction for state S2. An arc from S1 to S2 with label ¬R indicates the desired state transition. ¬R R ¬R & A R ∨ ¬A S2 0- S1 0- S0 0-
  • 19. 19 This figure shows the final state diagram (STG) for device STOP. ¬R ¬R ¬R R R R ¬R R ¬R&A R ∨ ¬A R ∨ ¬A ¬R&A Final state diagram for serial to parallel converter S2 0- S1 0- S0 0- S5 1Z S4 0- S3 0-
  • 20. 20 3.2. Transition List Approach Present Transition Next Data Output state Expression State Transfers S0 R ∨ ¬A S0 None DONE =0 S0 ¬R & A S1 Z unspec. S1 ¬R S2 Store bit 1 DONE = 0 S1 R S0 Z unspec. S2 ¬R S3 Store bit 2 DONE = 0, S2 R S0 Z unspec. S3 ¬R S4 Store bit 3 DONE = 0, S3 R S0 Z unspec. S4 ¬R S5 Store bit 4 DONE = 0 S4 R S0 Z unspec. S5 ¬R & A S1 None DONE = 1, Z = paral. data out S5 R ∨ ¬A S0 Principle of Mutual Exclusion. No two expressions on different arcs can be true simultaneously. For example for node S0, (¬R & A)&( R ∨ ¬A) = ¬RAR ∨ ¬RA¬A = 0
  • 21. 21 entity STOP is port (R, A, D, CLK: in BIT; Z: out BIT_VECTOR (3 downto 0); DONE: out BIT); end STOP; architecture FSM_RTL of STOP is type STATE_TYPE is (S0, S1, S2, S3, S4, S5); signal STATE: STATE_TYPE; signal SHIFT_REG: BIT_VECTOR (3 downto 0); begin STATE: process (CLK) begin if CLK = ‘1’ then case STATE is when S0 => if R = ‘1’ or A = ‘0’ then STATE <= S0; elsif R = ‘0’ and A = ‘1’ then STATE <= S1; end if; when S1 => SHIFT_REG <= D & SHIFT_REG(3 downto 1); if R = ‘0’ then STATE <= S2; elsif R = ‘1’ then STATE <= S0; end if; when S2 => SHIFT_REG <= D & SHIFT_REG (3 downto 1); if R = ‘0’ then STATE <= S3; elsif R = ‘1’ then STATE <= S0; end if;
  • 22. 22 when S3 => SHIFT_REG <= D & SHIFT_REG (3 downto1); if R = ‘0’ then STATE <= S4; elsif R = ‘1’ then STATE <=S0; end if; when S4 => SHIFT_REG <= D & SHIFT_REG (3 downto1); if R = ‘0’ then STATE <= S5; elsif R = ‘1’ then STATE <=S0; end if; when S5 => if R = ‘0’ and A =’1’ then STATE <= S1; elsif R = ‘1’ or A = ‘0’ then STATE <= S0; end if; end case; end if; end process STATE; OUTPUT: process (STATE) begin case STATE is when S0 to S4 => DONE <= ‘0’; when S5 => DONE <= ‘1’; Z <= SHIFT_REG; end case; end process OUTPUT; end FSM_RTL;
  • 23. 23 I Z CLK Block diagram for model of a state machine. Control circuit synthesized from VHDL description (serial to parallel converter) TO FROM CONDITION STATE STATE S0 S0 R + ¬A S0 S1 R S0 S2 R S0 S3 R S0 S4 R S0 S5 R + ¬A S1 S0 ¬R A S1 S5 ¬R A S2 S1 ¬R S3 S2 ¬R S4 S3 ¬R S5 S4 R Data Unit Control Unit Output Unit
  • 24. 24 Control section synthesis list for serial to parallel converter. One-hot coding stile S0 S0 S5 ¬R A R ¬A R ¬R S1 A S2 S3 S5 S4 S2 S3 S4 S1 ¬R ¬R ¬R ¬R 1 1 1 & & 1 D Q ¬Q 1 & & D Q ¬Q & D Q ¬Q & D Q ¬Q D Q ¬Q D Q ¬Q & & S5 S1
  • 25. 25 Synthesis list for data unit for serial to parallel converter. Data Transfer State Condition SHIFT_REG <= D & SHIFT_REG (3 downto 1) S1 1 SHIFT_REG <= D & SHIFT_REG (3 downto 1) S2 1 SHIFT_REG <= D & SHIFT_REG (3 downto 1) S3 1 SHIFT_REG <= D & SHIFT_REG (3 downto 1) S4 1 Data unit for serial to parallel converter. SHIFT_REG(3) SHIFT_REG(2) SHIFT_REG(1) SHIFT_REG(0) D S1 S2 S3 S4 SHIFT = S1+S2+S3+S4 The output unit DONE = S5 Z = SHIFT_REG D3 D2 D1 D0 S1 SHIFT REGISTER SH