Forum: FPGA, VHDL & Verilog Error in shift operator

von Hayder A. (Company: NA) (hayder)

Rate this post
0 useful
not useful

I have this error in my verilog  code:
 case (aexp[14] ^ bexp [14])
        1'b0 :   bman = bman << (aexp- bexp);
        1'b1 :   bman = bman << (aexp+ bexp);

here, if the sign bit [14] is equal, so sub aexp - bexp then shift the 
bman by the difference.
or if they are not equal so add them and shift.

but in my simulator I cant see bman shift at all, so i change the code 
to :
 case (aexp[14] ^ bexp [14])
        1'b0 :   diff = bman << 3;//(aexp- bexp);
        1'b1 :   diff = bman << 2;//(aexp+ bexp);

also there is no value in diff !!
could you please help me


Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [vhdl]VHDL code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]

Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.