Array and clocked signal

Hello,
I m basically trying to implement a PRBS or similar signal generator using vector and discrete clock signal. But it does not seem that both can be handled simultaenously. Am I right or is there a way to use both ? Br

using ModelingToolkit: t_nounits as t
dt = 0.1                # Sample interval
clock = Clock(dt)    # A periodic clock with tick rate dt
k = ShiftIndex(clock)

@mtkmodel prbs_16 begin
    @variables begin
        state(t)[1:16] = rand(Bool,16) |> BitArray
        out(t)
        input(t)
    end
    @equations begin
        state[1](k-1) ~ state[2](k)
    end
end

# @named prbs=prbs_16()
@mtkbuild prbs=prbs_16()
ODEProblem(structural_simplify(prbs),tspan = (0.0, 10.0))

Right now it cannot use both together. It should be giving you an error that says exactly that.

Ok thanks for the answer, so I need a hint as I struggle … I just want to construct a block that outputs band limited white noise. So basically it shall update a variable each x.x seconds.
I tried with a call back but as you only modify a value, an equation is needed for the variable and so it throws too many variables error. I tried using @dicrete_events with

1 => x ~rand()

but it only evaluates rand the first time it is called …
Any advice is welcome BR
Yves-Julien Regamey