Question

I would like to take the ceil of the signal in Simulink(Xilinx Library). So, if for instance, the signal value is 1.5, the output would be 2.

Any suggestion on how can I implement it in Simulink ?

Also, I am keen to understand the approach how for instance floor,round function could be implemented as well.

Any blocks in xilinx library which does it ?

Thanks

Kiran

Was it helpful?

Solution

Not sure there's a block for it, but you could use an mcode block I think and put the Matlab ceil function in it.

Or you could build a block which uses Slice blocks to separate the integer and fractional parts and increment the integer part if the fractional part is not zero.

For rounding and flooring, the Cast block will round or truncate for you, you have to manage the output type yourself though.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top