aboutsummaryrefslogtreecommitdiffstats
path: root/src/hal/components/bitslice.comp
blob: 937cfb17624ef6656279810df89eb8e99deac7b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
component bitslice "Converts an unsigned-32 input into individual bits";
description """This component creates individual bit-outputs for each bit of an
unsigned-32 input. The number of bits can be limited by the "personality"
modparam.
The inverse process can be performed by the weighted_sum HAL component.""";
pin in u32 in "The input value";
pin out bit out-##[32:personality];
author "Andy Pugh";
license "GPL2+";
function _ nofp;
option personality yes;
;;
int i;
for (i = 0; i < personality ; i++){
out(i) = (in >> i)&1;
}
bues.ch cgit interface