0
\$\begingroup\$

So I finally got my 4-Bit CPU working on Logisim, and am trying to get it to do commands and display them, but am unable to do so. My CPU looks like the following: 4-Bit CPU

I am trying to implement the following commands or opcodes into the Decoder (Address Bit Width = 4, Data Bit Width = 8):

Opcode table

And my PROM (Address Bit Width = 4, Data Bit Width = 16) Gives an output as follows: PROM

Question 1: How do I create a simple program following these guidelines that will take 3 + 4 and add them, displaying each number, digit and symbol, as well as the result. (I.e. What goes in decoder, and what in the PROM?)

Question 2: How do I figure out how to display simple letters on the display? (I want to type Hello World).

I'm not much of a low-level programmer, but understand the concepts so help would be appreciated.

I have a file named Hello.txt which can be used to load a program into the PROM, however it doesn't display the correct output, which should be: "Hello BJ". Instead it shows random characters. https://pastebin.com/HbtaA04i

The way the PROM and the Decoder commands are as is follows: Table

An example of the PROM would be:

0011 0000 0001 0110 - Display the contents of registers 1 and 6. At the end of the operation, a 3716 will be sent to the display, and a “7” will be displayed (refer to an on-line ASCII table for doing display writes).

\$\endgroup\$
  • \$\begingroup\$ For question 2, you need to read the documentation that tells how the display device/object works. Nobody here will be interested in reading that documentation for you. \$\endgroup\$ – The Photon Apr 9 '18 at 22:42
  • \$\begingroup\$ @ThePhoton It's the "TTY" object in Logisim. It has a 7-bit bus (left side above the clock), a clock (left side), a WE pin (bottom, left-most, active-HI), and a CLEAR pin (bottom, just right of the WE pin, active-HI.) How that thing works is the least of the problems here. \$\endgroup\$ – jonk Apr 9 '18 at 22:53
  • \$\begingroup\$ I added a test program I use, however it displays random letters and not intended output. \$\endgroup\$ – Rivasa Apr 9 '18 at 22:58
  • \$\begingroup\$ @Annabelle Yes, I'm sure that's correct. But the TTY device works fine if you are using it correctly (easy to do) and if your CPU is operating fine (who knows?) and if you wrote your code correctly to run properly on that CPU (again, who knows?) The problem is not the TTY device. However, Just looking at the program isn't enough because none of us know if your CPU is working correctly. And looking at the CPU in detail won't be enough because the program might not be written correctly. Anyone trying to help will have to do both. And that is a huge ask for most of us. \$\endgroup\$ – jonk Apr 9 '18 at 23:19
  • \$\begingroup\$ I am fairly certain that the CPU is made correctly, what is an easy way to verify that it is? \$\endgroup\$ – Rivasa Apr 9 '18 at 23:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.