summaryrefslogtreecommitdiff
path: root/src/hal/components/bitslice.comp
blob: 4eb44c68f6bfe047da2c88c58655561e53683138 (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 perfomed 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;
}