Left shift circulate integer modulo function block
This block realizes a left shift circulate integer modulo function.
The output is the left shift circulate N bit of the input word,
define by a length of Nbit bits using the 2 complement arithmetic notation.
Then, the values of the output are comprise between
.
This function is described by a nonconstant amplitude. Following the number
of shift, this nonlinearity takes different slope.
Fig.1 shows an example for a given length (Nbit=5), for one shift and two shift.
Figure 1: Nonlinear function lcmodulo for Nbit=5. (a) One shift; (b) Two shifts
This function is modelled with binary operators of C language.
First block begins to convert input value, in an unsigned integer value.
After it realizes N times the left shift.
Table.1 shows necessary stages to realize this operation
for an integer value defined by a length of 8 bits.
Table 1:
Computation stages of the left binary shift circulate operation
Stages |
Operations |
Decimal |
Binary |
1 |
Read unsigned integer value |
150 |
1001 0110 |
2 |
Left shift binary |
300 |
1 0010 1100 |
3 |
Tronquate to 8 bits |
44 |
0010 1100 |
4 |
Addition of the tronquate bits |
45 |
0010 1101 |
Computational function finally converts unsigned integer value in signed integer value and puts results in output register y.
- Number of bit
The number of bit per integer.
Properties : Type 'vec' of size -1.
- Number of shift
The number of binary left shift applied on input at each event.
Properties : Type 'vec' of size -1.
- always active: no
- direct-feedthrough: yes
- zero-crossing: no
- mode: no
- regular inputs:
- port 1 : size [1,1] / type 1
- regular outputs:
- port 1 : size [1,1] / type 1
- number/sizes of activation inputs: 0
- number/sizes of activation outputs: 0
- continuous-time state: no
- discrete-time state: no
- object discrete-time state: no
- name of computational function: lcmodulo
- MODNUMCOS/macros/scicos_blocks/NonLinear/LCMODULO_f.sci [view code]
- MODNUMCOS/routines/nonlinear/lcmodulo.c (Type 2) [view code]
IRCOM Group Alan Layec