0
$\begingroup$

I've been going through the control signal table and I noticed something confusing on when I should set the value as 'don't care' or 0 for control signal.

For example when doing the R type add instruction, we don't go through the data memory. When we are done with addition inside the ALU, the result will justbypass the data memory and will be written on the destination register.

So I thought, being 'don't care' for the MemWrite and MemRead would also be ok rather than being 0. But on the signal table, it says 0.

I wonder where the differences are made when deciding rather to put 'don't care' and 0.

Thanks!

$\endgroup$
  • $\begingroup$ All this very likely depends on the specific architecture. There are many versions of mips. Could you specify the precise architecture by editing your question? Thanks. $\endgroup$ – Discrete lizard Apr 7 '18 at 15:32
  • $\begingroup$ 0 seems more sensible for the R-type add instruction, as you positively don't want to perform a memory operation.. However, I have to say that I'm not sure what "don't care" is for... Can you refer to a text? $\endgroup$ – Erik Eidt Apr 9 '18 at 3:59
  • $\begingroup$ I've asked my class assistant and he gave me a same answer as you did Erik. I meant by either 0 or 1 would be alright for MemWrite and MemRead since we are not using the memory for add instruction. Leaving the control signal as don't care(either 0 or 1) can somehow simplify the process(As long as remember). $\endgroup$ – kyung sub Song Apr 9 '18 at 6:32
  • $\begingroup$ This is from a book 'Computer Organization and Design: The Hardware/Software Interface'. I am not sure which architecture it is. Thanks anyways lizard! $\endgroup$ – kyung sub Song Apr 9 '18 at 6:34
  • $\begingroup$ Ok, for certain instructions in certain pipeline stages, we don't care about the results or operation of one or more of the functional units. All the hardware is always there, but not all is always being used. So, for example, when doing an unconditional branch instruction, the ALU is still there doing something, but we don't care about it. However, when it comes to memory we never want to initiate a memory reference read with a garbage address let alone a write. Even a read to a good address could disrupt the cache. So, we never want to do a memory reference that isn't indicated. $\endgroup$ – Erik Eidt Apr 9 '18 at 14:05
1
$\begingroup$

For certain instructions in certain pipeline stages, we don't care about the results or operation of one or more of the hardware's many functional units.

Let's say the processor implementation has several functional units, e.g. in the ALU, for addition/subtraction, one for and/or, one for multiplication, one for division, one for shifting, and maybe even (separate from the ALU) one for computing addressing, e.g. combined shift & add for the various load & store instructions.  there may also be a completely separate adder next to the PC for doing pc-relative branches.

All that hardware is always there, but not all is always being used.

So, for example, when doing an unconditional branch instruction, the regular ALU is still there doing something, but we don't care about it.  All we have to do is ignore the unit's output, e.g. don't write it to a register.

So, at the times when we don't care about the regular ALU's output, we also don't care about the signals going into the ALU — the source operands, and the code that says whether to add vs. and vs. other.  We need to ignore not just the ALU's output, then but also any signals like overflow.  However, that is pretty easy to do, so sometimes this is done (ignoring output while giving "don't care" input), instead of instructing the ALU to do something specific during don't care, like adding 0 + 0.

However, when it comes to memory we never want to initiate a memory reference with a potentially garbage address, even a read, let alone a write, which could be destructive of program state.  Keep in mind that the memory reference goes thru the cache and then potentially off-chip, to the memory devices, and/or to I/O devices.  We don't even want to issue a read to a known or hard-coded address (like 0).  If the instruction isn't a memory reference, we should not touch memory at all!!  And we do that by forcing both the read and write signals to 0.

$\endgroup$

Your Answer

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

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