Ok Jow Forums I'm fucked I totally forgot about this assignment to design a 16 bit CPU and now I don't fucking know...

ok Jow Forums I'm fucked I totally forgot about this assignment to design a 16 bit CPU and now I don't fucking know what to do anyone knows any of this shit and is willing to help

Attached: DOvFZGM.png (1342x904, 79K)

Other urls found in this thread:

eater.net/8bit/
class.ece.iastate.edu/arun/Cpre381_Sp06/lectures/MIPS_SC.pdf
twitter.com/AnonBabble

I did an 8-bit processor in undergrad.

What's your question specifically?

Step 1: Design a 16bit CPU
See? easy.

I'm just sort of lost overall, I can manage to make a simple processor that stores values and does calculations between registers and so on but what he's asking of us is to make a processor capable of handling loops, if conditions and initialize a register entry. I know it doesn't sound too complicated but it's kind of overwhelming considering the last assignment we had was to just design an ALU

>the last assignment we had was to just design an ALU
A CPU is just an ALU with a memory controller

I mean, that's one way of putting it but the CPU also has to take into consideration a clock and counter and so on, I don't know maybe I'm freaking out which is why it seems so complicated.

>a clock and counter and so on
That's pretty trivial if you've already made an ALU. Clock and ripple counter is literally the first digital design most people do.

>I don't know maybe I'm freaking out which is why it seems so complicated.
You're just overwhelmed, but seriously just sit down and start with the ALU, and the rest will follow pretty easily.

eater.net/8bit/
dunno about 16bit

You only have one clock to worry about, it's not that complicated. Just make sure your registers are fed clock, and then have a way for your instructions to encode input and output registers (ie. RA, RB, RC). Then, parse that coding out of your instruction (bit fields) and use them to index your register map.

For the looping and if statements, it's fairly simple. You need to encode a conditional jump instruction. You can simply make it jump based on the value of a register that you specify (populated by a prior calculation) or use some of special condition code register that gets updated by ALU ops. Or a million other ways to do it. Your instruction should also encode your destination address somehow (or where to get it, like a register). If the condition for the jump is met, write the destination address to your Program Counter. You've got one, right? It should step through your instruction memory every clock cycle.

I essentially followed something like this:

class.ece.iastate.edu/arun/Cpre381_Sp06/lectures/MIPS_SC.pdf

Without knowing exactly what you're going over in class it's difficult to know exactly how far your teacher is expecting you to go. For example, do you need to implement pipe-lining?

But I thought the counter should've been used even before the if statements and loops were introduced, at least that's what I understood from the professor's instructions PDF

You *do* need the counter to step through your instructions before your introduce the conditionals, yes.

Your PC (program counter) is used to fetch an instruction from IMEM (instruction memory), and then is incremented. The fetched instruction then goes into an instruction decoder which breaks up the fields based on the op code and decides what to do with that instruction (ie how to use your ALU etc.). So yes, get that going first because it's how you actually advance in your program execution. Then, once you're comfortable with that (write a simple program that adds like 5 numbers and verify the result), add the conditional instructions that can directly update the program counter.

No, no pipe-lining from my understanding. From what I've been reading online it's a fairly simple processor, basically what it's meant to do is utilize our ALU which only has add,subtract,shift left right, AND,OR, and NOT on it. And with this ALU use the operations between the Registers which we had to make(which to my understanding is something really simple to do right?).

Attached: aLOgx54.png (964x820, 57K)

Your instructions should just encode the values for those register muxes to get your operands and destination locations.

This is one of the starting parts of the assignment, we have to make a fairly simple processor where the way the instructions work is that the first 4 bits are used for the ALU operator. The next 3 bits are the number of the register for which we want to use and the next 3 for the other register then the next 3 bits are where we'll store the results of what we get from the ALU with Reg_A and Reg_B. So something like this seems correct? Also sorry for asking so many questions it's just I'm a foreigner student and have a lot of difficulties talking things out with both professors and classmates due to the language.

Attached: processor.png (1028x1422, 68K)

Yes, that will work. You can re-use that for your processor. In fact it looks like you already have some condition codes (Negative, Zero) etc. which you can use for your conditional instructions.

To add though, why are you guys using this schematic entry stuff? I find writing Verilog/VHDL is much simpler and more transferable to actual industry.

So basically now all I have to do is make the loop, and if conditions and it should be fine? Also this is kind of a side question but how does this processor even work? Like I'm not sure I follow how the counter works alongside the processor because from what I get out of this is that the counter is always increasing so going from 0 to 15 constantly while the clock ticks. But wouldn't that mean that it's basically applying a different instruction at every tick of the clock?

I'm not sure, to be fair this is our first year, after this year is done we have to choose whether we want to specialize in Programming, Material or Telecommunications and this is part of the material part, how processors work, microprocessors etc etc. This year is just to show us what each different branch does and next year we start working harder on each, I'm personally taking Programming so I think this is the last time I'll be working on this but it's still necessary to pass this semester. From what I know in second year people mostly work on programming this sort of thing but written in C and other languages

Yeah, that's the general idea. You execute an instruction per clock, read from your IMEM. The counter is the address to your IMEM. Your counter will wrap back to 0 after 15 and the program will automatically start over again too.

Ahhhhhhhh, now everything makes more sense. I honestly had no idea of what the need for the counter there was, I thought I was connecting something wrong as this way all it does is run every single instruction followed by each other.