Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
17 years ago

numerical representation help

i tried a simple model such as following:

a constant block with value -8/3 connected to five inputs are set as following:

1: Bus Type = Signed Fractional

Number of Bits [.] = 5

[.] Number of Bits = 0

2: Bus Type = Signed Fractional

Number of Bits [.] = 4

[.] Number of Bits = 1

3: Bus Type = Signed Fractional

Number of Bits [.] = 3

[.] Number of Bits = 2

4: Bus Type = Signed Integer

Number of Bits [.] = 4

[.] Number of Bits = 1

5: Bus Type = UnSigned Integer

Number of Bits [.] = 3

[.] Number of Bits = 2

all the inputs are connected to a Multiplexer then to a Display

the figure of the model is attached.

when i start simulation, i get error complaining the mixed data type. any advice?

3 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    You're not allowed to use a Simulink mux like that. Simulink muxes create "vectors" of signals and as such each signal must be of the same type. You could convert them all to the same type before connecting them to the mux or you could just create a scope with 5 inputs and connect them directly to the scope.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Within Altera input and output blocks, almost Simulink blocks are allowed (the only exceptions that I can think of are the subsystem block and the scope block). It's illegal to mix and match simulink and Altera blocks like that. If anything, you would have to convert them back to Matlab type before you can use the mux.