06-02-2019, 07:50 AM
You can declare 702 as a constant if you like and do a bit more arithmetic with symbols rather than numbers
When you're doing mutliple switchable output standards or aspect ratios you're going to end up with CASE statements to select all the parameters. A CASE statement can take an integer or SLV as its argument, integer usually looking better. You can set up some constants to make it look better still.
constant ASPECT4x3 := 0;
constant ASPECT5x4:= 1;
etc
Thent he CASE statement reads like this:
case OUTPUTASPECT is
when ASPECT4x3
X1 <= constant1
X2<= constant2
etc
when ASPECT5x4
X1 <= constant5
X2<= constant6
etc
when others
......
end case;
Here's an example of my own code showing mutliple cases in a single when (using vertical bar as separator) and compile time arithemtic which generates no logic. HMAXFIX is a fiddle factor I defined as a constant so I could use sensible looking numbers.

When you're doing mutliple switchable output standards or aspect ratios you're going to end up with CASE statements to select all the parameters. A CASE statement can take an integer or SLV as its argument, integer usually looking better. You can set up some constants to make it look better still.
constant ASPECT4x3 := 0;
constant ASPECT5x4:= 1;
etc
Thent he CASE statement reads like this:
case OUTPUTASPECT is
when ASPECT4x3
X1 <= constant1
X2<= constant2
etc
when ASPECT5x4
X1 <= constant5
X2<= constant6
etc
when others
......
end case;
Here's an example of my own code showing mutliple cases in a single when (using vertical bar as separator) and compile time arithemtic which generates no logic. HMAXFIX is a fiddle factor I defined as a constant so I could use sensible looking numbers.
Code:
case XSTD is
when S1080_60i | S1080_30p | S1080_60p => HMAX_VALUE <= 2200 - HMAXFIX;
when S1080_50i | S1080_25p | S1080_50p => HMAX_VALUE <= 2640 - HMAXFIX;
when S1080_24sF | S1080_24p => HMAX_VALUE <= 2750 - HMAXFIX;
when S720_60p => HMAX_VALUE <= 1650 - HMAXFIX; when S720_50p => HMAX_VALUE <= 1980 - HMAXFIX;
when S720_30p => HMAX_VALUE <= 3300 - HMAXFIX; when S720_25p => HMAX_VALUE <= 3960 - HMAXFIX;
when S720_24p => HMAX_VALUE <= 4125 - HMAXFIX;
when S525_60i => HMAX_VALUE <= 858 - HMAXFIX; when S625_50i => HMAX_VALUE <= 864 - HMAXFIX;
when others => HMAX_VALUE <= 864 - HMAXFIX; -- Catch all other cases
end case;
www.borinsky.co.uk Jeffrey Borinsky www.becg.tv







