-1
\$\begingroup\$

I'm very new to circuit design. I've built an ALU and now I only need a control unit for three operations, "Addition", "Logic bitwise AND" and "right logic shift". What is the most efficient way(least number of additional components) to do that on my current design?

My ALU. enter image description here

My other instinct is to find a control unit out there and connect it with this ALU some how but I feel is over kill and struggling with it: How do I pass the 4 bit memory address back to my instruction Instruction address register and pass that data within memory into a register

I'd much rather not go this direction implementing RAM and multiple instruction register if I can do it efficiently to achieve a control unit that can achieve the 3 operations. Can someone show me how?

\$\endgroup\$
15
  • 2
    \$\begingroup\$ But... by way of an example, here is a sample instruction decoder taken from Neeman's DIGITAL examples directory. Note the "ROM" there? \$\endgroup\$
    – jonk
    Commented Jun 28, 2021 at 17:16
  • 3
    \$\begingroup\$ It is a bad idea to ask for the "most efficient" solution...engineers usually define their requirements and look for a solution that is "good enough". Also, you need to define what you mean by "efficient". Gate count? Transistor Count? Delay time? Clock speed? Silicon area? Design time? \$\endgroup\$ Commented Jun 28, 2021 at 17:40
  • 2
    \$\begingroup\$ @nvs0000 Did the diagram make sense to you? You just use a ROM to decode out all the control signals required. If you need a sequence of control signals (say, four clocks per instruction and different control signals for each clock) then you include two added bits for addressing the ROM which are based upon a 2-bit FF counter tied to the clock. \$\endgroup\$
    – jonk
    Commented Jun 29, 2021 at 1:56
  • 1
    \$\begingroup\$ @nvs0000 Perhaps I assumed too much when reading your question. Do you have any memory in your simulation that can hold a program for you? You know, like 100 instructions for computing successive Fibonacci sequence numbers? Something like that? Or haven't you solved that problem, yet? \$\endgroup\$
    – jonk
    Commented Jun 29, 2021 at 4:09
  • 1
    \$\begingroup\$ We are not going to do your schoolwork for you, it's as simple as that. You must show us that you have made a serious effort to do this yourself, and I don't mean pulling random stuff from YouTube. When you have something that is close to working, ask a specific question. \$\endgroup\$ Commented Jun 29, 2021 at 10:52

1 Answer 1

1
\$\begingroup\$

From the questions you ask, it looks like you have an idea how to do logic design, but you are struggling to connect it together. You could use a different design methodology to get better results. You are using a bottom-up methodology, that does not seem to scale up for you. So I advise you to use a top-down methodology instead.

Create a block diagram of the CPU first. Sketch the datapath and then identify the control signals. Create a truth table and design the control unit. Once that is complete, you can connect the ALU you built to your control unit.

Learn how a CPU works first, if you don't already know. I can recommend this free online course on Computer Architecture to get a sound understanding of how a CPU works: https://learn.saylor.org/course/view.php?id=71

If your demux or counter is not working, I would suggest to check if all your input signals are driven. From the figure you have posted, it looks like you have a few unconnected inputs.

\$\endgroup\$
7
  • \$\begingroup\$ I tried going specific and even rephrasing, but it seems like it needs more context as well. All i'm trying to nail down here is how to pass the memory address back into RAM: electronics.stackexchange.com/questions/573385/… /// Are you able to help? \$\endgroup\$
    – nvs0000
    Commented Jul 3, 2021 at 1:03
  • \$\begingroup\$ @nvs0000 looks like a user busybee has already helped you by writing a useful comment on your question. Start by thinking over the comments you get. \$\endgroup\$ Commented Jul 3, 2021 at 3:38
  • \$\begingroup\$ @nvs0000 no, it's not so simple. You are asking "does this control unit work with my ALU" - This question hints at a lack of understanding of how CPU design works. You need to do a block diagram first. \$\endgroup\$ Commented Jul 3, 2021 at 3:39
  • \$\begingroup\$ thanks. I don't know if I'm overkilling for this question or not. It's worth only 5%, which is why I asked for the most efficient way to implement a control unit that performs addition, logic bitwise AND, and right logic shift per requirement. I've struggled with it for weeks now. Every other way I see requires building an entire control unit with RAM. Does a control unit technically need RAM?... \$\endgroup\$
    – nvs0000
    Commented Jul 3, 2021 at 7:17
  • \$\begingroup\$ @nvs0000 You need instruction memory. RAM is used to store the program \$\endgroup\$ Commented Jul 3, 2021 at 7:21

Not the answer you're looking for? Browse other questions tagged or ask your own question.