Implement the comparison operations

Assignment Help Computer Engineering
Reference no: EM131013633

Detailed Question: Build a CPU

Overview

This is first part of a two-part project in which you will build a simple, but complete computer in Logisim. For this part, you will build three components that will be key parts of the overall computer design.

Each of these components should be created as separate circuits. For this assignment, you should use the "main" circuit to test the three components. In part 2 of this assignment, you will build the complete computer which will incorporate the components from this assignment, with some additional logic.

Arithmetic Logic Unit

The first of three components is an Arithmetic Logic Unit (ALU) which is a circuit which can perform multiple operations on input values.

The ALU should have three input pins:

The first argument which is a 16-bit value.

The second argument which is also a 16-bit value.

The operation code, or "opcode" which selects which of its operations the ALU should perform on the arguments. The opcodes are given below:

Opcode Operation Meaning
0 And output = in1 & in2
1 Or output = in1 | in2
2 Xor output = in1 ^ in2
3 Not output = ~in1
4 Add output = in1 + in2
5 Subtract output = in1 - in2
6 Multiply output = in1 * in2
7 Set less than output = (in1 < in2) ? 1 : 0
8 Shift left output = in1 << in2
9 Shift right output = in1 >> in2
10 - output = in1
11 - output = in1
12 - output = in2
13 - output = 0
14 Equal Zero? output = (in1 == 0)
15 Not Equal Zero? output = (in1 != 0)

The ALU should contain a single output pin which is a 16-bit value containing the result of the operation as described above.

The blank operations will be used for operations such as memory accesses that do not use the ALU. Each of the outputs just passes along an input (or 0) which will make wiring is slightly simpler.

In order to build the ALU, you should route the arguments through circuits which compute each of the results, and route those into a multiplexer (under the "Plexers" menu). Use the opcode as the selector input of the multiplexer.

To implement the comparison operations, use a "Comparator" circuit. Because our CPU will support negative numbers, you should use 2′s complement comparisons.

For this reason, the right shift operation should be done using an "arithmetic right shift", which maintains the sign bit as it shifts, as opposed to a "logical right shift" which does not.

The comparators output a single bit. In order to extend this to the 16-bit result, you can use a "bit extender" to zero extend the value (pad some number of zeroes to the end).

To test your ALU, create one in main, and connect pins for the inputs and the opcode, and connect the output to an output pin. Check that each opcode works as described above on a few inputs each.

Register File

The register file is a very small memory that contains the working set of values used by our computer. The register file stores just 16 registers, each of which is 16 bits large. The register file supports two reads and a write at the same time.

The register file should take the following inputs:

The clock signal, so that the writes can be synchronized with the rest of the CPU.

A clear signal, which can be used to set all 16 registers back to 0.

The write data, which is a 16-bit value.

The write address, which is a 4-bit value which determines which of the 16 registers we are writing.

A write enable signal, which is a single bit and determines whether we are doing a write this clock cycle. If 0, nothing is written. If 1, then the write happens when the clock goes from low to high.

Read address 1, which is a 4-bit value determining which of the registers to read for the first read value.

Read address 2, which is a 4-bit value determining which of the registers to read for the second read value.

The register file has only two outputs:

Read 1 value, which is a 16-bit value giving the first read value.

Read 2 value, which is a 16-bit value giving the second read value.

To create the register file, add 16 registers from the "memory" section and set them to store a 16-bit value. Connect all of the clear inputs to the incoming clear signal, and all of the clock inputs to the incoming clock signal.

To allow data to be stored in the register file, connect the write data to the data port of each register. You must ensure that data is only written to each register when the incoming write enable input is true, and also when the write address matches the register in question. You should use a "decoder" for this purpose (under the Plexers menu). The decoder will transform the 4-bit address into 16 1-bit selection lines. You should change the decoder's "disabled output" to "zero" instead of "floating".

To allow the register file to be read, you should connect each of the register output values into a multiplexer, and use the read address input as the multiplexer's selector signal. The output of the multiplexer would then give you the value of the register being read. You will need to to this twice: once for each of the two values we can read.

To test your register file, create one in main and connect pins to it. It should store values which you can later retrieve using the read and write inputs.

Screen Memory

Our CPU is going to have a screen somewhat like the Game Boy Advance in that the pixel values are mapped to a section of memory. Writing into this memory will update the screen. To support this, you should create a screen memory component.

The screen memory is similar to the register file in that it will store 16 values which are each 16-bits. Our computer's screen will be 16 rows by 16 columns, and be monochrome - each pixels is either on or off. Each of the 16 registers represents one row, and each bit position represents one column.

The screen memory will also be capable of reading and writing values, and will contain the following pins:

The clock signal, so that the writes can be synchronized with the rest of the CPU.

A clear signal, which can be used to set all pixels to 0.

The write data, which is a 16-bit value. Each write will be for an entire row.

The write address, which is a 4-bit value which determines which of the 16 screen rows we are writing.

A write enable signal, which is a single bit and determines whether we are doing a write this clock cycle. If 0, nothing is written. If 1, then the write happens when the clock goes from low to high.

The read address, which is a 4-bit value determining which of the registers to read. Unlike the register file, only one read can happen at a time.

The screen memory has one 16-bit output which provides the value read using the read address.

The screen memory will have an additional 16 output pins, each of which is 16 bits. These will provide each of the 16 rows and will be fed into the actual screen of the computer.

To test the screen memory, create one in main, and try to store and retrieve values. If you want to see how it will work when connected to a screen, you can add an "LED Matrix" from the Input/Output section, and set it to be 16 by 16, and set the Input Format to be Rows. Then connect the 16 row outputs of the screen memory to the 16 inputs to the LED screen.

Reference no: EM131013633

Questions Cloud

What is the point elasticity : If P=100 - 2Q, and P=80, what is the point elasticity?You sell bracelets online. The demand for these bracelets is:P=120 - 2Q
Savings account at the end of each year : Parents deposit $5,000 into a savings account at the end of each year for 22 years to help their child pay for college. The savings account pays 6% interest per year, compounded monthly. The child withdrawals an equal sum twice per year while in coll..
Installation of an automatic telephone switchboard : The management of a private hospital is considering the installation of an automatic telephone switchboard, which would replace a manual switchboard and eliminate the attendant operator's position. The class of service provided by the new equipment i..
Briefly describe the phenomenon of magnetization : State the relationship between polarization current density and electric field intensity. How is it taken into account in Maxwell's equations? What is the revised definition of D?
Implement the comparison operations : This is first part of a two-part project in which you will build a simple, but complete computer in Logisim. For this part, you will build three components that will be key parts of the overall computer design.
Maintenance and operations costs for a piece of equipment : The maintenance and operations costs for a piece of equipment are estimated to be $700 the first month and increase by $20 per month over the equipment's 3 year life. For budgeting purposes, the owner wants to set aside a uniform amount each month to..
Determine the ratio of blood flow : Assuming that the other variables affecting blood flow remain the same (that is, it in equation (2) remains the same), use equation (2) to determine the ratio of blood flow in the 5M% laded artery vs. the oPen artery.
Extra amount required for investment consistent : When projecting growing cash flows into perpetuity, the estimate should take into account the extra amount required for investment consistent with any projected growth in operating profit. (True, False, Uncertain and explain your response)
Calculate perfectly competitive equilibrium : The market for a box of POG's is defined by Qd-P and Qs.a) Calculate perfectly competitive equilibrium, consumer surplus, and producer surplus.  Include a detailed graph.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Name an instruction used to call a subroutine

Name an instruction used to call a subroutine. Name the register(s) that change(s) in value after the instruction is executed.

  Describe the readability and usefulness of the online user

question 1 discuss the readability and usefulness of the online user manual that you have researched. identify its

  Which type of network devices would be supported

You have been asked to generate a paper that compares and contrasts guided versus wireless media for inclusion in your company's knowledge database.

  Implement a global eworksheet system to track attendance

Implement a global eWorksheet system to track attendance and work-hours for all associates across its global locations - Typical challenges/risks you foresee in the quality of project deliverables and the risk njanagement plan.

  Question1 why should you use dissimilar password policy

question1. why should you use dissimilar password policy options available with the exception of storing the password

  Discuss at least two ways that you can help to control

discuss at least two ways that you can help to control what information is readily available about you to anyone

  Determining the sample rate

Find the appropriate values of the sampling rate fs, the quantizing level L, and the binary digits n, assuming fM = 3.2 kHz.

  Write a c function named change that has a floating point

Call the function change from main function three times and print out the contents of the variables quarters, dimes, nickels, and pennies after each function return.

  What do you mean by sensitivity analysis how would you use

what is a sensitivity analysis? how would you use it in planning for future expansions? what role does this kind of

  Scope of work for penetration test

Scope of Work for Penetration Test

  Developing the java program

Create a block utilizing a loop which will calculate the number of items which can be purchased on the basis of price of the item and total amount available to spend.

  In the united states there are hundreds of federal and

in the united states there are hundreds of federal and state government agencies that regulate different functions of

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd