Besides doing an xor, is there a better way to get the compl

B

Brian

Guest
To date, I usually do this (reg being an 8 bit register):

----------------------------------------------------
reg_compliment[7:0] <= reg_in[7:0] ^ 255;
----------------------------------------------------

I figured that this shou have worked:

----------------------------------------------------
reg_compliment[7:0] <= !reg_in[7:0] ;
----------------------------------------------------

However, my compiler doesn't like it. I'm using Altera's internal
Quartus verilog compiler.
 
Fond it, never mind. it was the ~ .


Brian wrote:
To date, I usually do this (reg being an 8 bit register):

----------------------------------------------------
reg_compliment[7:0] <= reg_in[7:0] ^ 255;
----------------------------------------------------

I figured that this shou have worked:

----------------------------------------------------
reg_compliment[7:0] <= !reg_in[7:0] ;
----------------------------------------------------

However, my compiler doesn't like it. I'm using Altera's internal
Quartus verilog compiler.
 
Fond it, never mind. it was the ~ .


Brian wrote:
To date, I usually do this (reg being an 8 bit register):

----------------------------------------------------
reg_compliment[7:0] <= reg_in[7:0] ^ 255;
----------------------------------------------------

I figured that this shou have worked:

----------------------------------------------------
reg_compliment[7:0] <= !reg_in[7:0] ;
----------------------------------------------------

However, my compiler doesn't like it. I'm using Altera's internal
Quartus verilog compiler.
 

Welcome to EDABoard.com

Sponsor

Back
Top