HDL
HDL
HDL
Experiment – 6
Objective:
To write a VHDL program to implement Up Counter
Resources Required:
Hardware Requirement: Computer System
Software Requirement: XILINX ISE Design Suite 14.7 Software
Evaluation Board: Spartan 3AN starter kit
Device: XC3S700N
Theory:
A counter is a device which stores (and sometimes displays) the number of times
a particular event or process has occurred, often in relationship to a clock
signal. Counters are used in digital electronics for counting purpose, they can
count specific event happening in the circuit. For example, in UP counter a
counter increases count for every rising edge of clock. Not only counting, a
counter can follow the certain sequence based on our design like any random
sequence 0,1,3,2… .They can also be designed with the help of flip flops. They
are used as frequency dividers where the frequency of given pulse waveform is
divided. Counters are sequential circuit that count the number of pulses can be
either in binary code or BCD form. The main properties of a counter are timing
, sequencing , and counting. Counter works in two modes: Up counter and
Down counter. Counters are sequential logic devices that follow a predetermined
sequence of counting states which are triggered by an external clock (CLK)
signal. The number of states or counting sequences through which a particular
counter advances before returning once again back to its original first state is
called the modulus (MOD). In other words, the modulus (or just modulo) is the
number of states the counter counts and is the dividing number of the counter.
The decade counter has four outputs producing a 4-bit binary number, it receives
an input clock pulse, one by one, and counts up from 0 to 9 repeatedly.
Application:
1. Digital Clocks: Up counters are widely used in digital clock circuits to keep
track of time. With each clock pulse, the counter increments, allowing it to
generate the time in hours, minutes, and seconds.
2.Traffic Light Controllers: Up counters are employed in traffic light control
systems to sequence the timing of traffic lights. Each count corresponds to a
specific state in the traffic light sequence, helping regulate traffic flow..
Truth Table:
VHDL Code:
Behavioral Modelling
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity Upcounter_114 is
Port ( clk : in STD_LOGIC;
C : inout integer:=0);
end Upcounter_114;
architecture Behavioral of Upcounter_114 is
begin
process (clk)
begin
if(clk'event and clk='1')
then if (C<=C+1; else if(c=9)
then c<=0;
end if;
end if;
end if;
end process;
end Behavioral;
Output and Observation:
Results:
VHDL codes of 4-bit UpCounter has been implemented and simulated
successfully. Resulting output is satisfying the truth table of 4-bit up Counter.
Observed time delay is 4.7ns from timing details and 10.13ns from post route
simulation.
Date: 9-10-2023
Experiment – 7
Objective:
Write a VHDL Program to generate the 1010 sequence detector. The
overlapping patterns are allowed.
Resources Required:
Hardware Requirement: Computer System
Software Requirement: XILINX ISE Design Suite 14.7 Software
Evaluation Board: Spartan 3AN starter kit
Device: XC3S700N
Theory:
A sequence detector is a digital circuit or algorithm designed to identify the
presence or absence of a specific sequence of binary bits in a stream of input
data. It is commonly used in digital signal processing, communication systems,
and control systems. The sequence detector monitors the input stream and
produces an output when the specified sequence is detected. There are two
primary types of sequence detectors: synchronous and asynchronous.
Synchronous Sequence Detector:
In a synchronous sequence detector, the detection process is synchronized with
a clock signal. The input stream is sampled at specific clock intervals, and the
detection logic operates based on these clocked samples. The most common type
of synchronous sequence detector is the Finite State Machine (FSM), which uses
a set of states and transitions to recognize sequences.
Asynchronous Sequence Detector:
An asynchronous sequence detector, on the other hand, doesn't rely on a clock
signal for sampling. It continuously monitors the input and triggers the detection
logic whenever the specified sequence is identified. Asynchronous detectors are
often simpler than synchronous ones but may be more susceptible to noise and
timing variations.
Fig:7.1 Schematic of a clocked synchronous state machine (Moore
Machine).
A sequential circuit’s behavior can be shown in a state diagram. The state diagram
for our sequence detector is shown below. Each circle represents a state and the
arrows show the transitions to the next state. Inside each circle are the state name
and the value of the output. Along each arrow is the input value that corresponds
to that transition. A sequence detector accepts as input a string of bits: either 0 or
1. Its output goes to 1 when a target sequence has been detected. There are two
basic types: overlap and non-overlap. In a sequence detector that allows overlap,
the final bits of one sequence can be the start of another sequence.
Example: 11011 detector with overlap X 11011011011 Z 00001001001
11011 detector with no overlap Z 00001000001
Results:
VHDL codes of Sequence-Detector has been implemented and simulated
successfully. Resulting output is satisfying the truth table of Sequence-Detector.
Observed time delay is 4.677ns from timing details and 10.42ns from post route
simulation.
Date: 16-10-2023
Experiment – 8
Objective:
Write a VHDL code to implement serial to parallel of 4 bit binary number.
Resources Required:
Hardware Requirement: Computer System
Software Requirement: XILINX ISE Design Suite 14.7 Software
Evaluation Board: Spartan 3AN starter kit
Device: XC3S700N
Theory:
Serial-to-parallel conversion is a process in digital electronics where a series of
bits are converted from a serial (one bit at a time) format to a parallel (multiple
bits at a time) format. To convert a 4-bit number from serial to parallel, you
typically need a shift register. Here's a basic explanation of the process:
Serial-to-Parallel Conversion of a 4-Bit Number:
Process:
1. Serial Input:The 4-bit serial input is fed into the first bit of the shift register.
2. Shift Operation:
- On each clock pulse, the contents of the shift register are shifted to the right.
- The serial input bit is loaded into the leftmost (most significant) bit of the
shift register.
3. Shift Cycle:
- After four clock pulses, all four bits of the serial input will be loaded into the
shift register.
4. Parallel Output:
- At this point, the parallel output is available at the four output taps of the
shift register.
- The bits at each output tap represent the 4-bit parallel representation of the
serial input.
Example:
Let's say we have the 4-bit serial input "1101". The process would be as follows:
- Clock 1: Shift register = "0111" (shifted right, new bit loaded at the left).
- Clock 2: Shift register = "1011".
- Clock 3: Shift register = "1101".
- Clock 4: Shift register = "1110".
After four clock pulses, the 4-bit parallel output is "1110".
- The speed of the clock pulses determines the rate at which the serial bits are
loaded into the shift register.
- The shift register needs to be designed for serial-to-parallel conversion, with
the appropriate clock and control signals.
This process is commonly used in various applications, including serial
communication protocols, where data is transmitted serially but needs to be
processed in parallel by the receiving device.ns.
Results:
VHDL codes of 4-bit serial-to-parallel-converter has been implemented and
simulated successfully. Resulting output is satisfying the truth table of 4-bit
serial-to-parallel-converter. Observed time delay is 5.558ns from timing details
and 8.736ns from post route simulation.
Date: 23-10-2023
Experiment – 9
Objective:
Write a VHDL program to perform parallel to serial transfer of 4 bit binary
number.
Resources Required:
Hardware Requirement: Computer System
Software Requirement: XILINX ISE Design Suite 14.7 Software
Evaluation Board: Spartan 3AN starter kit
Device: XC3S700N
Theory:
Parallel-in/ serial-out shift registers do everything that the previous serial-in/
serial-out shift registers do plus input data to all stages simultaneously. The
parallel-in/ serial-out shift register stores data, shifts it on a clock by clock basis,
and delays it by the number of stages times the clock period. In addition, parallel-
in/ serial-out really means that we can load data in parallel into all stages before
any shifting ever begins. This is a way to convert data from a parallel format to a
serial format. By parallel format we mean that the data bits are present
simultaneously on individual wires, one for each data bit as shown below. By
serial format we mean that the data bits are presented sequentially in time on a
single wire or circuit as in the case of the “data out” on the block diagram below.
Results:
VHDL codes of parallel to serial transfer of 4 bit binary number has been
implemented and simulated successfully. Resulting output is satisfying the truth
table of parallel to serial transfer of 4 bit binary number. Observed time delay is
5.531ns from timing details and 7.873ns from post route simulation.
Date: 5-11-2023
Experiment – 10
Objective:
Write a program to design a 2 bit ALU containing 4 arithmetic & 4 logic
operations.
Resources Required:
Hardware Requirement: Computer System
Software Requirement: XILINX ISE Design Suite 14.7 Software
Evaluation Board: Spartan 3AN starter kit
Device: XC3S700N
Theory:
The Arithmetic Logic Unit (ALU) is a crucial component within a computer's
central processing unit (CPU) responsible for executing arithmetic and logic
operations on binary data. It performs fundamental operations like addition,
subtraction, multiplication, division, and logical comparisons. The ALU operates
based on control signals from the CPU, directing it to execute specific tasks.
Applications:
1.Data Processing: The ALU is at the core of data processing in computers,
handling numerical calculations and logical operations necessary for executing
programs.
2.Cryptography: ALUs are used in cryptographic algorithms to perform
complex mathematical operations required for secure communication,
encryption, and decryption.
3.Graphics Processing: In graphics processing units (GPUs), specialized ALUs
handle parallel processing tasks related to rendering and manipulating graphical
images and video.
4.Scientific Computing: ALUs are crucial in scientific simulations and
calculations, where intricate mathematical operations are required for modeling
physical phenomena, conducting simulations, and analyzing data.
VHDL Code:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
en ty ALU_114 is
end ALU_114;
begin
PROCESS(inputA,inputB,sel)
BEGIN
case sel is
end case;
END PROCESS;
end alu_114;
Output and Observation:
Results:
VHDL codes of ALU has been implemented and simulated successfully.
Resulting output is satisfying the truth table of different operations of ALU.
Observed time delay is 11.303ns from timing details and 8.68ns from post route
simulation.
HARDWARE DESCRIPTION LAB FILE
SUBJECT-CODE: ECLR 71