Search This Blog

Tuesday, June 19, 2018

CREATING CALCULATOR USING LOGISIM (PART 3)


THE PROCESSING PART OF THE CALCULATOR




The processing part involve majorly the Operators which perform the multiplication, Division, Addition and Subtraction. Each Operator key on the Keypad is linked to each operation circuit that perform each Arithmetic operation. Each operator is connected to a multiplexer with a 2 bit selector which select 4 different operators when pressed. Below the multiplexer is a 4 to 2 encoder that connect the four operator to 2 output which goes into a register to store the data and transmit it to select part of the MUX (multiplexer). As a key operator is pressed, it select an operation and direct the result to a 4 BIT BCD. A splitter is used to split 16 bits output to different 4 bits result to be display on the 4 digits hex seven seg. Display. Create your processing part by following the diagram and choose the appropriate components from the library. Notice each tunnels on the part of the circuits, they are the connecting part of the processing parts to the Display part. Check the Display part for the same tunnels bearing the name with each tunnel in diagram. Your Display circuit should bear the same component as shown in the Diagram below.


PLEASE CLICK THIS XML FILE AND CLICK THE LINK BELOW TO COPY A FILE INTO A MS NOTE PAD AND SAVE IT AS CALCULATOR LIB.circ 

This file is needed to create some of the component use in this project that is not in Logisim.

Please post comment to show areas that is not clear to you. thanks






Wednesday, June 13, 2018

CREATING CALCULATOR USING LOGISIM (PART 2)

THE LED DISPLAY

The LED display is the one that display the value of the Key pressed and also the result of the computation.



The figure above show the LED display and all the circuit that make it display numeric information. The component containing 3 in four places is the shift Register. It has four aspect of it. On the left side we have three pins, one to enable serial shift or disable it, the second is for the input of numeric data, the third is the clock. The clock is for updating the information entering the register.
On the left side is the serial output. Above and below are the parallel input and parallel output. simultaneous information are loaded through the parallel input and can be output serially or in parallel.
For our Calculator, we have Ten input OR gate to output each key pressed. These input are the tunnels of each keys. A tunnel showing DATA is the result of the key pressed at any point in time. The Register has four stages to represent four digits on the Display (when you choose your register, change the property to four stages and four bits). The moment the digits are exhausted the second OR gate come into action igniting the negated part of the AND gate joining it with first OR gate to stop further input into the Shift Register. Under the register is the first pin which can be used to clear the screen. An input with zero is attached to it. And when it is one the screen will clear.
To create your LED display, choose Hex Digit Display from the Input/Output folder and put four of it beside each other as shown on the diagram. To make the LED Display to show the key pressed from the right, connect the LED on the right to the first stage of the shift register as shown, the second LED to the right to the second stage of the Register and so on. Also notice that the Second OR gate to stop the display when it is full is connected to the last stage of the Shift register. So that the moment the fourth stage is occupied it trigger the AND gate to stop further input.
PLEASE CHECK BACK FOR THE 3RD PART WHICH HAS TO DO WITH PROCESSING AND CALCULATIONS.

Sunday, June 10, 2018

CREATING CALCULATOR USING LOGISIM


THE INPUT PART

A Calculator is made up of 3 parts . The input (Keypad), output (digital display) and the processor.
The Calculator panel consist of a lot of components that work together to process numerical information. Though in normal Calculator you may not see all this. What you see is a central processor which have integrated all this components together.

In the class, we have seen and demonstrate how to create an adder, subtractor, multiplier, except for the divider. Also , we have discuss the multiplexer which help to select data source. Data to be fetched are stored in component called registers. To be able to fetch data, data are given addresses. so, multiplexer help to locate the data by selecting the address of the data.

One thing we have also learn is the conversion of binary to decimal by using BCD to seven segment converter  and then display it with seven segment LED display. In Calculator, the keypad shows decimal numbers 0 to 9. Each decimal numbers have binary equivalent understood by the machine.

In the Calculator, there is a register that contain what is called key code for each key on the keypad. When a key is pressed, the code is transmitted and move to the display register to display the key pressed. Usually when  a key is pressed it bounce back the moment it is released, but the register store the data transmitted.

On the Calculator is also found the operators for addition, subtraction, division and multiplication. When these are pressed the calculator has to perform switching operation among these operators, These are carried out by multiplexer. Multiplexers have what is called selection mode, which depend on the number of inputs required e.g 4 inputs required 22 – 2n  Where n is number of selection. So, two bits will be required for 4 inputs.

You are going to create the calculator in parts. The display part, the keypad part and processing parts and connect or link them by a component called 'Tunnel' in Logisim.


Follow the diagram shown and try to pick from Logisim those components as shown. From the library open Memory and pick registers. Change them to 4 bits. Get Tunnel from the folder called wiring and label it to bear the caption with that of the keys. Check for the diagram of the key for the tunnels attached and label your own accordingly. The tunnel help to avoid wiring which may make the design clumsy. The component label MUX is the multiplexer. You can pick this from the folder labelled Plexers. Change the the Data bit and Sel bit to 4. Then it will look like the one shown. Position it as it is shown, that is facing south. Create this part and test to see what happen when you press any key. Lastly, under wiring you will see a component called constant. It is the gray coloured component bearing number 0 to 9 attached to the 'D' part of the register. when you pick it. change it to four bit and the value to 0x and the number (e.g 0x2 for value of 2). 


KEY SELECTION PROCESSING

The next stage in fetching a number when a key is pressed is to select the number that will be display on the LED display. From the diagram, it show that all the registers for each key are connected to the multiplexer, but all of them cannot be output at the same time. We need to create a program that will do the selection. 4 bits are needed to select the ten numbers, so we need a circuit that will convert the decimal numbers to 4 bit binary numbers. We are going to create our converter by using Combinational Analysis as you have been taught.

The problem with this is that when add your input and output the input is always set aready for you then change the output to your taste. In this case, we are going to pick out of what have been set those binary numbers that start with 1 in each row to represent the different decimal numbers. So you select the row that have only 1 under the particular number and neglect the others. Then you change the output to bear the binary number for that decimal number.
The example is shown below.




Create your inputs starting with N9 up to N0 so that it will appear as shown. Also add your outpu in the following order D, C, B, A. Then you will have the table shown above. The first row should be zero throughout. Second row has 1 under N0, Which mean when you click number zero you should get zero. 1 under N1 mean when you click number 1 you should have 0001 which stand for number 1. So do this for all the numbers up to number 9. Then click build circuit and call your circuit DEC TO BIN ENCODER. Under your main, select this circuit you have created and connect it as shown below.


This diagram indicate that the same copy of tunnel that was used for each key is also attached to the input of the ENCODER 1 to N1, 2 to N2 up to N9. Then choose a splitter from wiring and connect it with the ENCODER as shown. You can see that a register is also connected to pick the value when the key is pressed. pick an OR gate and connect the same tunnel of the keys and the output connected to the register as shown. Combine this with the first circuit and click each key and see what happen to the output at the end of MUX as shown earlier.
The second stage will be uploaded very soon. So, return to the site to check for the second stage.