Muthuraja.M
Advanced Member level 4
- Joined
- Jul 20, 2013
- Messages
- 101
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 16
- Activity points
- 634
Hi friends,
I need to know about the conditional operator clearly. Even though i do some of the examples as mux using conditional operators. But i didn't understand wat actually doing in the below code..
Actually this code has the inverting of input as its output when the gate is logic'1' and give the input as it the output when the gate is logic'0'.
But i need the operation used in this code.
Please clarify this..
Thanks in advance...
I need to know about the conditional operator clearly. Even though i do some of the examples as mux using conditional operators. But i didn't understand wat actually doing in the below code..
Code Verilog - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 module rumania(gate, D, Q); parameter Bi = 16; parameter prop_delay = 0; input gate; input [Bi-1:0] D; output [Bi-1:0] Q; assign Q = gate ? ((D[Bi-1] & !(|D[Bi-2:0])) ? {1'b0, {(Bi-1){1'b1}}} : (- D)) : D; endmodule
Actually this code has the inverting of input as its output when the gate is logic'1' and give the input as it the output when the gate is logic'0'.
But i need the operation used in this code.
Please clarify this..
Thanks in advance...
Last edited by a moderator: