0% found this document useful (0 votes)
14 views13 pages

Barrel

The document presents a report on the simulation of a 4-bit barrel shifter using Verilog as part of a Bachelor of Engineering course in Electronics & Communication. It details the functionality, operation, and design of the barrel shifter, which allows for efficient data shifting in digital systems, and includes results from simulations demonstrating its performance. The report also outlines the course objectives and outcomes, emphasizing the importance of VLSI design and testing in modern engineering education.

Uploaded by

harshitha5906
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views13 pages

Barrel

The document presents a report on the simulation of a 4-bit barrel shifter using Verilog as part of a Bachelor of Engineering course in Electronics & Communication. It details the functionality, operation, and design of the barrel shifter, which allows for efficient data shifting in digital systems, and includes results from simulations demonstrating its performance. The report also outlines the course objectives and outcomes, emphasizing the importance of VLSI design and testing in modern engineering education.

Uploaded by

harshitha5906
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

VISVESVARAYA TECHNOLOGICAL UNIVERSITY

BELAGAVI - 590 018

A REPORT ON COURSE-PROJECT WORK

SIMULATION OF 4-BIT BARREL SHIFTER USING VERILOG


Submitted in the partial fulfilment of the requirements for the award of the degree of

BACHELOR OF ENGINEERING
in
ELECTRONICS & COMMUNICATION
Course: VLSI Design and Testing (BCE602)
Associates

ADITI C G 4BD22EC001
HARSHAVARDHAN H S 4BD22EC039
HARSHITHA R 4BD22EC041
RAKSHITHA A G 4BD22EC071

Dr. Nirmala S O M.E, Ph.D.


Project Guide

Dr. G S Sunitha M.Tech. (DEAC), Ph.D., MISTE, FIETE., FIE. Dr. H B Aravind M.E., Ph.D., MISTE, FIE

Program Coordinator Principal

Bapuji Educational Association®


Bapuji Institute of Engineering and Technology
Davangere – 577004
Department of Electronics & Communication Engineering
2024-2025
VISION OF THE INSTITUTE

To be a center of excellence recognized nationally and internationally, in distinctive areas


of engineering education and research, based on a culture of innovation and invention.

MISSION OF THE INSTITUTE

BIET contributes to the growth and development of its students by imparting a broad-
based engineering education and empowering them to be successful in their chosen field
by inculcating in them positive approach, leadership qualities and ethical values.

VISION OF THE DEPARTMENT

To be in the forefront in providing quality technical education and research in Electronics


& Communication Engineering to produce skilled professionals to cater to the challenges
of the society.

MISSION OF THE DEPARTMENT

M1. To facilitate the students with profound technical knowledge through effective teaching
learning process for a successful career.
M2. To impart quality education to strengthen students to meet the industry standards and face
confidently the challenges in the program.
M3. To develop the essence of innovation and research among students and faculty by providing
infrastructure and conducive environment.
M4. To inculcate the student community with ethical values, communication skills,leadership
qualities, entrepreneurial skills and lifelong learning to meet the societal needs
Course objectives:
1. This course deals with analysis and design of digital CMOS integrated circuits.
2. The course emphasizes on basic theory of digital circuits, design principles and techniques
for digital design blocks implemented in CMOS technology.
3. This course will also cover switching characteristics of digital circuits along with delay
and power estimation.
4. Understanding the CMOS sequential circuits and memory design concepts. 5. Explore the
knowledge of VLSI Design flow and Testing.

Course outcome:

After completing the course, the students will be able to

CO1: Apply the fundamentals of semiconductor physics in MOS transistors and analyze the
geometrical effects of MOS transistors.

CO2: Design and realize combinational, sequential digital circuits and memory cells in
CMOS logic.

CO3: Analyse the synchronous timing metrics for sequential designs and structured design
basics.

CO4: Understand designing digital blocks with design constraints such as propagation delay
and dynamic power dissipation. C05 Understand the concepts of Sequential circuits design
and VLSI testing
S. No. Section Title Page No.

1 Abstract

2 Introduction

3 Working and Operation of a 4-Bit Barrel Shifter

4 Block Diagram and Description

4 Simulation and Result

5 Conclusion
1. Introduction

4-bit barrel shifter is a digital circuit used in computer systems and digital electronics to perform rapid data
shifting operations. Unlike a regular shifter, which shifts data one bit at a time and requires multiple clock
cycles, a barrel shifter is capable of shifting data by multiple positions in a single operation or clock cycle.
This capability makes barrel shifters highly efficient in processors and digital signal processing (DSP)
applications, where fast data manipulation is critical.

The basic function of a 4-bit barrel shifter is to shift a 4-bit binary input (e.g., A3 A2 A1 A0) either to the
left or right by a specified number of positions, ranging from 0 to 3. It can also perform rotations, where the
bits that fall off one end are wrapped around to the other end. Barrel shifters can be designed for logical
shifts, arithmetic shifts, or circular (rotational) shifts. In logical shifts, zeros are inserted into the vacated bit
positions, whereas in arithmetic shifts (used primarily with signed numbers), the sign bit is preserved during
right shifts. Rotational shifts recycle the bits, moving them to the opposite end.

The architecture of a 4-bit barrel shifter typically consists of a network of multiplexers arranged in stages.
Each stage corresponds to a single-bit shift (i.e., 1, 2, or 3 positions). The control inputs, often 2 bits wide
(since 2 bits can represent 4 values: 00, 01, 10, 11), determine how many positions the input data should be
shifted. The use of multiplexers enables the circuit to quickly choose between different shifted versions of
the input, all in parallel, making the shift operation independent of the number of positions being shifted.
This is the key advantage over serial shifters.

For example, if the input is 1011 and the control input specifies a shift of 2 positions to the left, the result
would be 1110 (assuming a logical left shift). If it were a right circular shift instead, the result would be
1110 as well, but for different reasons—the rightmost two bits (11) would wrap around to the leftmost
positions.

Barrel shifters are widely used in modern computing architectures, particularly in arithmetic logic units
(ALUs), floating-point units, and digital signal processors. They contribute to performance optimization by
reducing the number of clock cycles needed for operations involving bit shifts and rotations. For example,
shifting bits is a common operation in multiplication and division by powers of two, bit masking, and
bitwise encoding schemes.
2. Working and Operation of a 4-Bit Barrel Shifter
A 4-bit barrel shifter is a digital circuit that shifts a 4-bit binary input either left or right by 0 to 3 positions in
a single clock cycle. Unlike regular shifters that move bits one step at a time, a barrel shifter shifts all at
once using a combination of logic gates or multiplexers.

Key Components:

Input (data_in): 4-bit binary value (e.g., 1011)

Shift amount (shift_amt): 2-bit value (from 00 to 11 = 0 to 3)

Shift type (shift_type): 2-bit control to select operation:

00: Logical Shift Left (LSL)

01: Logical Shift Right (LSR)

10: Rotate Left (ROL)

11: Rotate Right (ROR)

Output (data_out): 4-bit result of the shift

Shift Types:

1. Logical Shift Left (LSL - 00)

Moves all bits to the left, inserts zeros on the right.

Example:

Input = 1011, Shift = 1

Output = 0110

2. Logical Shift Right (LSR - 01)

Moves all bits to the right, inserts zeros on the left.

Example:

Input = 1011, Shift = 2


Output = 0010

3. Rotate Left (ROL - 10)

Moves bits to the left, and wraps the shifted-out bits to the right end.

Example:

Input = 1011, Shift = 1

Output = 0111

4. Rotate Right (ROR - 11)

Moves bits to the right, and wraps the shifted-out bits to the left end.

Example:

Input = 1011, Shift = 1

Output = 1101

The barrel shifter uses multiplexers to choose where each bit in the output comes from. For example, to
rotate left by 2 bits:

data_in = 1011

(data_in << 2) = 1100

(data_in >> (4 - 2)) = 0010

Result = 1100 | 0010 = 1110


3. Block Diagram and Description

Fig 4.1.1 Block Diagram

This block diagram represents a 4-bit Barrel Shifter, a digital circuit used to shift data efficiently without
using sequential shifting operations. It is commonly used in processors and digital signal processing units to
perform high-speed data manipulation.

Inputs:

1. data_in [3:0]

This is the primary 4-bit data input to the barrel shifter. It represents the binary value that needs to be
shifted. Each bit in this input can be either 0 or 1, and together they form a nibble (4 bits).

2. shift_amt [1:0]

This 2-bit input determines the number of positions the input data will be shifted. Since it is 2 bits, it can
represent values from 0 to 3, allowing the circuit to shift the input data by 0, 1, 2, or 3 positions.

3. shift_type [1:0]

This 2-bit control input specifies the type or direction of the shift operation. Common shift types may
include:

00: Logical left shift (fills with 0s on the right)

01: Logical right shift (fills with 0s on the left)

10: Arithmetic right shift (preserves the sign bit, commonly used for signed numbers)

11: Rotate (circular shift where bits shifted out are wrapped around to the other side)
Output:

data_out [3:0]

This is the 4-bit output that results after the specified shift operation is performed on the input data. The
output will vary based on both the shift_amt and the shift_type.
4. Result and Discussion

Fig 5.1.1 Output Waveform

1. Functionality Verification

The waveform shows that the 4-bit barrel shifter responds correctly to different shift types and shift
amounts. The inputs data_in, shift_amt, and shift_type are varied, and the corresponding output data_out
changes as expected. This confirms that the shifter is functionally operational across multiple modes of
shifting.

2. Observed Shift Operations

Logical Left Shift (shift_type = 00): The data shifts left and fills with zeros from the right.

Example: data_in = 1011, shift_amt = 01 → data_out = 0110

Logical Right Shift (shift_type = 01): The data shifts right and fills with zeros from the left.

Example: data_in = 1011, shift_amt = 01 → data_out = 0101

Arithmetic Right Shift (shift_type = 10): Similar to logical right, but fills the leftmost bit with the MSB to
preserve the sign in signed data.

Example: data_in = 1011 (signed: -5), shift_amt = 01 → data_out = 1101

Rotate Shift (shift_type = 11): The data is rotated circularly.

Example: data_in = 1011, shift_amt = 01 → data_out = 1101 (right rotation by 1)


3. Bitwidth and Output Analysis

All operations are applied on 4-bit inputs and outputs (data_in[3:0], data_out[3:0]). The simulation
demonstrates correct maintenance of bit-width throughout, with no data loss or overflow observed.

4. Test Coverage

Shift Amounts from 0 to 3 (00 to 11) are tested for each shift type.

Shift Types (00, 01, 10, 11) are exercised.

This ensures full test coverage of all possible shift operations and edge cases
5. Conclusion
The simulation of a 4-bit barrel shifter using Verilog EDA Playground provide a practical and effective way
to understand the behaviour and functionality of data shifting operations in digital systems. Through this
platform, we observe how the barrel shifter performs logical shifts and rotations (left and right) based on
control inputs, all in a single clock cycle.
6. References
1. https://www.youtube.com/watch?v=hnpTshRxHNE
2. https://www.edaplayground.com/x/8K7_

You might also like