4-BIT ALU IN LOGISIM
DESIGN BY FARHAN AHMED

4-BIT ALU IN LOGISIM

Hello readers, I am Farhan Ahmed. I design a 4-bit ALU using Logisim. Today I will tell you all you need to design your own 4-bit ALU using Logisim.

What is Logisim?

No alt text provided for this image

When learning computer architecture and logic circuits, you will need a real-world, graphical example of what you are studying. Text and diagrams only go so far. A helpful tool for designing and simulating logic circuits is?Logisim.

Because the tool lets you create large circuits from smaller circuits, you can design entire CPUs using Logisim. Further, the tool will run on any computer!

The interface itself is very intuitive and the use of color-coding of wires and elements allows for easy analysis and testing of circuits. You can also save the completed file as an image, or as a .circ file (core to Logisim).

you can read more about Logisim here: Introduction to Logisim: Setup & Overview | Study.com

You can download it easily from here: Logisim download | SourceForge.net

What is ALU?

No alt text provided for this image

In?computing, an?arithmetic logic unit?(ALU) is a?combinational?digital circuit?that performs?arithmetic?and?bitwise operations?on?integer?binary numbers.?This is in contrast to a?floating-point unit?(FPU), which operates on?floating-point?numbers. It is a fundamental building block of many types of computing circuits, including the?central processing unit?(CPU) of computers, FPUs, and?graphics processing units?(GPUs).

The inputs to an ALU are the data to be operated on, called?operands, and a code indicating the operation to be performed; the ALU's output is the result of the performed operation. In many designs, the ALU also has status inputs or outputs, or both, which convey information about a previous operation or the current operation, respectively, between the ALU and external?status registers.

You can read more here: Arithmetic logic unit - Wikipedia

Now we understand what ALU and Logisim are Let's start designing our 4-bit ALU in Logisim.

In this 4-bit ALU that I design there are three major parts:

  1. Arithmetic Unit (4-bit)
  2. Logical Unit (4-bit)
  3. Combinational Circuit Shifter (4-bit): right shift, left shift.

4-bit Arithmetic Unit

There are basically two components used in the Arithmetic Unit.

  1. 4 to 1 Multiplexer (MUX)
  2. Full adder

There are four 4:1 MUX and four Full Adders in my circuit. this arithmetic unit can perform 7 operations, including add, subtract, transfer, etc.

4-bit Logic Unit

There are four 4:1 MUX and 4 pairs of AND, OR, XOR, and NOT gates. In my circuit, we can perform the NOT operation on both inputs A and B. This Logic unit can perform 16 different logic operations that can be performed with two binary variables, including NAND, XOR, complement A, etc.

4-bit Combinational Circuit Shifter

A combinational circuit shifter can be constructed with multiplexers. The 4-bit shifter has four data inputs and four data outputs. There are two serial inputs, one for shift left and the other for shift right. When the selection input is 0, the input data are shifted right. When 1, the input data are shifted left.

Connecting above components

For connecting all components we can use four 4:1 MUX. The Four inputs in each MUX is as follows:

0 = Arithmetic Unit

1 = Logic Unit

2 = Shift Right

3 = Shift Left

The above signals are controlled by Selection inputs S3 and S2.

This ALU can perform the following operations:

  1. Transfer A
  2. Increment A
  3. Addition
  4. Add with carry
  5. Subtract with borrow
  6. Subtraction
  7. Decrement A
  8. Transfer A
  9. AND
  10. OR
  11. XOR
  12. Complement A
  13. Shift right A
  14. Shift left A

When we successfully connect all the components, we will get our 4-bit ALU ready. It will be looking like this:

No alt text provided for this image

Your ALU design can be different, but the Logic behind this will remain the same.

Thank you, for reading this article, hope this will help you in designing your own ALU.

Somi Ahmed

Student at Govt. KRG college Gwalior M. P. work at CSIR - CIMAP Lucknow

2 年

Keep it up Farhan...??. Best wishes for... Upcoming Life in this field ??

Dr. Pallavi Khatri

Professor at ITM University - Company

2 年

Good job. All the best for your future ventures!!!

要查看或添加评论,请登录

Farhan Ahmed的更多文章

社区洞察

其他会员也浏览了