ALU MISSDV0716 G.kaladhar Design Plan
ALU MISSDV0716 G.kaladhar Design Plan
Presented by
G.Kaladhar
MISSDV0716
Table of Contents
Chapter 1:
1.1. Introduction
1.2. Features
1.3. Functions and blocks of ALU
1.31. Opcode Decoder
1.32 Arithmetic Block
1.33. Logical Block
1.34. Comparator Block
1.35. Shifter/Rotator Block
1.36. Code converter Block
Chapter 2:
2.1. Opcode decoder
2.1.1. Description with an example
2.2. Arithmetic block
2.2.1. description with an example
2.3. Logical block
2.3.1. description with an example
2.4. Comparator block
2.4.1. description with an example
2.5. Shifter/Rotator block
2.5.1. description with an example
2.6 Code conversion block
2.6.1. description with an example
2.7. Logic fetch block
2.7.1. description with an example
All information in a computer is stored and manipulated in the form of binary numbers, i.e. 0 and 1.
Transistor switches are used to manipulate binary numbers since there are only two possible states of a
switch: open or closed. An open transistor, through which there is no current, represents a 0. A closed
transistor, through which there is a current, represents a 1.
Advantages:
ALUs support parallel architecture and applications.
They can provide the desired output simultaneously, handling both integer and floating-point
variables.
ALUs can carry out instructions on a large set of data items.
They have a high level of precision, making them versatile for various computational tasks.
ALUs can carry out instructions on a large set of data items.
They have a high level of precision, making them versatile for various computational tasks.
Disadvantages:
Memory space should be definite. Else bugs would occur in our result.
Their circuit is complex and therefore amateurs find it difficult to understand.
Floating variables have more delays.
Design controller is still more difficult to understand.
Rounding off is another con to be noted. Large numbers are generally rounded off thus
impacting accuracy.
Applications:
In this project, we have taken basic operations and we have used an 8-bit accumulator and auxiliary -
b register as inputs and a 16-bit output register along with 3 flags which are zero flags, carry flags, and done
flags.
Zero flag – 1 indicates the result of all Zeros.
-0- indicates the result is non-zeroes.
1) addition:
This is the basic addition of two 8-bit numbers. The output is 8 bits of sum and carry bit in the carry
flag of the 8th bit.
Eg: 1st input acc=8'b10100101; b_reg=8'b01100010;
opcode=4'b0001;//addition
The sum of the above two numbers is 1-00000111: here Msb bit is the carry bit and the
remaining 8 bits are the sum output. After the addition operation, the status register [4]bit-carry flag will be
affected.
Carry Flag-1- indicates there is a carry occurred after the addition.
-0- indicates there is no carry.
2) subtraction:
This is the basic addition of two 8-bit numbers. The output is 8 bits of sum and carry bit in the carry
flag of the 8th bit.
Eg: acc=8'b10010101; b_reg=8'b00011110;
opcode=4'b0010;//subtraction
The difference between the above two numbers is 1_00000111: Here Msb bit is the carry bit and the
remaining 8 bits are the difference output. After the subtraction operation, the status register [4] bit-carry
flag will be affected.
3) Multiplication:
Here the multiplication of two 8-bit numbers will be performed. The product to 8 bits is stored in a
16-bit final output register.
Eg: acc=8'b00001000; b_reg=8'b00001011;
opcode=4'b0011;//multiplication
The result of this 0000_0000_0101_1000.
4) Divider:
The division operation takes the input of two 8-bit numbers and performs the division operation.
Here we don’t use any flags.
Eg: acc=8'b10110111; b_reg=8'b01100010;
opcode=4'b0100;//division
The result is 0000_0000_0000_0001.
Eg:acc=8'b01110100; b_reg=8'b10010110;
opcode=4'b1100;//comparator(a<b)
If acc is equal to b_reg the carry bit is set to zero and the zero flag is also set to high.
Eg: acc=8b00011100; b_reg=8’b00011100;
Opcode=4’b1100;(==)
2.5 shifter/rotate block:
This block consists of a basic shifter and mechanisms for bit rotation. They accept only one 8-bit
operand. Thus, the type of rotation and the type of shifting command are specified by [7:4] and [3:0]
respectively.
The reference for shift/rotate selection is as follows:
Right shift:0000(opcode)
Left shift:0001
Circular Left shift:0010
Circular Right shift:0011
The right shift operator (>>) is a binary operator that takes two numbers.
The left shift operator (<<) is a binary operator that takes two numbers.
In a circular left shift, we move all the bits of a binary number to the left.
The bits that fall off from the left end are put back at the right end.
In a circular right shift, we move all the bits of a binary number to the left.
The bits that fall off from the right end are put back on the left side.
Right Shift
Left Shift
Waveform:
BLOCK DIAGRAM:
All blocks are integrated and the whole block follows:
CHAPTER-4
Conclusions & Enhancements
The alu is designed based on the specification given. By using this Alu we can perform arithmetic
operations like addition, subtraction, multiplication, division with data size of 8-bit, logical operations,
comparison of two 8-bit numbers, shifting/rotation operations, converting the 4bit binary number into Gray,
xs-3, xs-5, Bcd code.
This alu has some limitations. This alu will provide only integer type values when a division
operation is performed. In this design, the input & output registers are of the same bit width, and for status,
they have 4bits to show the opcode.
CHAPTER-5
Eda reference link:Reference:
Eda link: https://www.edaplayground.com/x/hHLe