On 16 Oct 2006 12:03:14 -0700, "Alex" <> wrote:
>I'm trying to find if there's a syntax for this (this doesn't work):
>
> OUTPUT_BIT <= ((value1_4bit & value2_4bit) - value3_8bit) (7);
>
>In summary, .. in a single statement, combining two 4 bit values,
>subtracting an 8bit value from them, and getting the most significant
>bit of the result. Is there a way to synthesize this outside of a
>process statement?
You can't subscript an expression, only an object. Make an
intermediate signal or variable to hold the result, and subscript
that. It'll synthesise just as well, and as Andy said it will be
easier to understand.
Alternatively, if the vectors are all of SIGNED data type, you
could simply test the result's sign:
OUTPUT_BIT <= '1' when
((value1_4bit & value2_4bit) - value3_8bit) < 0
else '0';
and in some situations that might be even clearer.
--
Jonathan Bromley, Consultant
DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services
Doulos Ltd., 22 Market Place, Ringwood, BH24 1AW, UK
http://www.MYCOMPANY.com
The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.