A Computers Architecture project on Barrel shifters
RohithRohith3
2,809 views
15 slides
Dec 08, 2016
Slide 1 of 15
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
About This Presentation
A Barrel Shifter is a logic component that perform shift or rotate operations. Barrel shifters are applicable for digital signal processors and processors, here we designed 16-bit barrel shifter using 2X1 MUXs in Logisim simulation
Size: 876.1 KB
Language: en
Added: Dec 08, 2016
Slides: 15 pages
Slide Content
1
COMPUTER ORGANIZATION AND ARCHITECTURE
PROJECT BASED LAB REPORT
On
16-BIT BARREL SHIFTER
Submitted in partial fulfillment of the
Requirements for the award of the Degree of
Bachelor of Technology
In
COMPUTER SCIENCE ENGINEERING
By
V.Sowjanya (150030965)
V.V.S. Hari Krishna (150030998)
S.V. Rohith (150031000)
UNDER THE GUIDENCE
OF
M.VASUJA DEVI
DEPARTMENT OF COMPUTER SCIENCE ENGINEERING
K L UNIVERSITY
Green Fields, Vaddeswaram, Guntur district-522 502
2
CERTIFICATE
This is to certify that the course based project titled 16 BIT BARRREL SHIFTER being
submitted by
V.SOWJANYA (150030965)
V.V.S.HARI KRISHNA (150030998)
S.V.ROHITH (150031000)
in partial fulfilment for the award of degree of Bachelor of Technology in COMPUTER
SCIENCE ENGINEERING is a record of bonfide work carried out by them under my
guidance during the academic year 2016-2017 and it has been found worthy of acceptance
according to the requirements of the university.
UNDER THE GUIDENCE
OF
M.VASUJA DEVI
3
DECLARATION
We hereby declare that this project based lab report entitled “16-BIT BARREL
SHIFTER” has been prepared by using logisim partial fulfilment of the requirement for
the award of degree “BACHELOR OF TECHNOLOGY in COMPUTER SCIENCE
AND ENGINEERING ” during the academic year 2016-17.
I also declare that this project based lab report is of our own effort and it has not been
submitted to any other university for the award of any degree.
Place: KLU
Date: Signature of the Student
4
ACKNOWLEDGEMENTS
My sincere thanks to Mr. SIDHESWAR ROVATRAY in the Lab for his outstanding
support throughout the project for the successful completion of the work.
We express our gratitude to Dr.V. SRIKANTH, Head of the Department for Computer
Science and Engineering for providing us with adequate facilities, ways and means by which
we are able to complete this term paper work.
We would like to place on record the deep sense of gratitude to the honorable Vice
Chancellor, K L University for providing the necessary facilities to carry the concluded term
paper work.
Last but not the least, we thank all Teaching and Non-Teaching Staff of our department and
especially my classmates and my friends for their support in the completion of our term paper
work.
By
S.V. Rohith-150031000
V.V.S. Hari Krishna-150030998
This project aims to build a 'BARREL SHIFTER' which is a digital circuit that
can shift a data word by a specified number of bits without the use of any sequential
logic, only pure combinatorial logic. One way to implement it is as a sequence of
multiplexers where the output of one multiplexer is connected to the input of the next
multiplexer in a way that depends on the shift distance. A barrel shifter is often used
to shift and rotate n-bits in modern microprocessors, typically within a single clock
cycle. Hence we intend on designing the circuit which could shift the given input of 8-
bits using the multiplexors. A common usage of a barrel shifter is in the hardware
implementation of floating-point arithmetic. For a floating-point add or subtract
operation, the significands of the two numbers must be aligned, which requires
shifting the smaller number to the right, increasing its exponent, until it matches the
exponent of the larger number. This is done by subtracting the exponents, and using
the barrel shifter to shift the smaller number to the right by the difference, in one
cycle. If a simple shifter were used, shifting by n bit positions would require n clock
cycles. Hence this shifter is useful for shifting n bits’ same time and has a real time
application in the microprocessors of the computers. So we intend to design the circuit
in the logisim software and simulate it to check the results of the circuit.
A Barrel Shifter is a logic component that perform shift or rotate
operations. Barrel shifters are applicable for digital signal processors and processors.
This component design is for a natural size (4,8,16…) barrel shifters that perform shift
right logical, rotate right, shift left logical, and rotate left operations depending on the
instantiation parameters. The left and right operation is implemented through
inversion of the input and output vectors, so the basic multiplexing function can
perform both operations. The number of multiplexing stages is relative to the width of
the input vector.
7
2. INTRODUCTION
A Barrel Shifter is a logic component that
perform shift or rotate operations. Barrel shifters are applicable for digital signal
processors and processors. This component design is for a natural size (4,8,16…)
barrel shifters that perform shift right logical, rotate right, shift left logical, and rotate
left operations depending on the instantiation parameters. The left and right operation
is implemented through inversion of the input and output vectors, so the basic
multiplexing function can perform both operations. The number of multiplexing
stages is relative to the width of the input vector.
A barrel shifter is a digital circuit that can shift a data word by a specified number of
bits. It can be implemented as a sequence of multiplexers. In this implementation, the
output of one MUX is connected to the input of the next MUX in a way that depends
on the shift distance. The number of multiplexers required is n*log2(n), for an n bit
word. Four common word sizes and the number of multiplexers needed are listed
below:
64-bit — 64 * log2(64) = 64 * 6 = 384
32-bit — 32 * log2(32) = 32 * 5 = 160
16-bit — 16 * log2(16) = 16 * 4 = 64
8-bit — 8 * log2(8) = 8 * 3 = 24
Basically, a barrel shifter works to shift data by incremental stages which avoids extra
clocks to the register and reduces the time spent shifting or rotating data (the specified
number of bits are moved/shifted/rotated the desired number of bit positions in a
single clock cycle). A barrel shifter is commonly used in computer-intensive
applications, such as Digital Signal Processing (DSP), and is useful for most
applications that shift data left or right - a normal style for C programming code.
Rotation (right) is similar to shifting in that it moves bits to the left. With rotation,
however, bits which "fall off" the left side get tacked back on the right side as lower
order bits, while in shifting the empty space in the lower order bits after shifting is
filled with zeros. Data shifting is required in many key computer operations from
address decoding to computer arithmetic. Full barrel shifters are often on the critical
path, which has led most research to be directed toward speed optimizations. With the
advent of mobile computing, power has become as important as speed for circuit
8
designs. In this project we present a range of 32-bit barrel shifters that vary at the gate,
architecture, and environment levels.
3. Design specification of circuit
Barrel shifter functionality
The Barrel shifter component is applicable for cases where an efficient logical shift or
rotate with a selectable shift amount is required. The component supports either shift
or rotate operations depending on the ROTATION parameter. When the ROTATION
parameter is set to 1, the barrel shifter performs rotation and when it is set to 0, a
logical shift operation is performed, shifting logical 0 in. the DIRECTION parameter
determines if the barrel shifter performs a left or right shift. Setting the DIRECTION
9
parameter to 0 would result in a left shift and setting it to 2 would result in a right
shift.
Logarithmic shift
The shift or rotate operation is done in stages where each stage performs a shift or
rotate operation of a different size. For example, a 5 bits shift operation would result
in a shift of 4 and a shift of 1 where the stage that performs the shift of 2 would not do
any shift. The select vector binary encoding is actually to enable the different stages of
the barrel shifter.
10
Shift direction
The direction of the rotate and shift operation is implemented by reversing the input and
output vector. Using this method allows for the shift or rotate logic to be kept simple,
performing only right shift. For a left shift, the input vector is reversed at the input, goes
through the shift logic which performs a right shift according to the select input and at the
output stage, it is reversed again, resulting in a left shift of the vector.
11
4. Implementation
Circuit with zero input and at initial stage
Here, 3 inputs are given.
12
Now the shifting is done as following using selection lines.
13
14
Applications:
Digital Signal Processing
Array Processing
Graphics
Database Addressing
High Speed Arithmetic Processors
15
10.CONCLUSION
The reason behind undertaking this project simply lies with the fact that there
are so many circuits that have more power consumption and delay, so to minimize the area
and delay we are using shifting or rotation. Here we are doing shift right logical, shift right
arithmetic, rotate right, shift left logical, shift left arithmetic, and rotate left. Four different
barrel shifter designs are presented and compared in terms of area and delay for a variety of
operand sizes. This is also examining techniques for detecting results that overflow and
results of zero in parallel with the shift or rotate operation. To resolve this purpose we have
made this very project, so that if such a kind of system is used then at least it may be able to
sense the shifting or rotation and accordingly necessary conditions can be undertaken.
11.FUTURE EXPECTS
The future expects of barrel shifter is that it minimizes the area and power
delay of the circuit. Area and delay estimates, based on synthesis of structural level VHDL,
indicate that data‐reversal barrel shifters have less area than two's complement or one's
complement barrel shifters and that mask‐based data‐reversal barrel shifters have less delay
than the other designs. As the operand size increases, the delay of the shifters increases as
O(log(n)) and their area increases as O (n log(n)). In to the future expectation we attach a
overflow detection logic, so the data should not be waste.
12.REFERENCES
1.www.quora.com
2.www.wikipedia.com
3.Electroincs Engineer's Reference Books by FF Mazda
4.Switching Theory by William Howard
5.Computer Organization and Architecture by William Stallings