Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to include BNE instruction in the following circuit without introducing a new control line. I have thought of many possible ways like adding muxes or and gates etc to implement it but after implementation, a problem always occured with any of the three instructions, PC+4 , BEQ and sometimes BNE itself. Now I need a little advice from the experts on how can I implement bne without introducing a new control line.Here is the circuit:

Circuit Diagram here

share|improve this question
I am not an EE, but how difficult would it be to convert the zero signal into a condition satisfied/branch taken signal? Obviously, the ALU and its control would be more complex, so that just seems to be shifting complexity around--again, I am not an EE. (BTW, I think some early MIPS implementations performed the branch condition evaluation in separate logic and performed the branch target calculation in the ALU.) – Paul A. Clayton Dec 6 '12 at 17:55

The MIPS architecture you pictured above already includes the required hardware for the BNE instruction.

The two register numbers which are part of the BNE instruction are passed into the Register File which then passes the data to the ALU. If they are equal then the zero flag is set. The instruction decode unit determines whether the branch flag is set based on a whole bunch of control signals which are already present (the aforementioned 0 flag, and a bunch of bits in the instruction opcode). Then the next address for the program counter is calculated based on the ALU on the top which handles adding the offset address to the current address.

Many people have implemented this instruction in the existing MIPS hardware so I am very confident you do not need additional control signals. For more detailed information you can look at the MIPS instruction set and architecture implementation. Here is one such example done in VHDL.

share|improve this answer
Actually, if you look at the VHDL, you'll see that the control unit actually has TWO signals to convey what is represented schematically as a single "branch" control signal: there are separate "branch" and a "branch_ne" signals. – marshaul Apr 10 '14 at 0:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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