matlab - Why is a sum statement so bizarrely synthesized? -


i have 4 buttons on fpga dev board wrote

function [hex0] = bar(key)   n = uint8(sum(key, 'native'));   ... 

unfortunately, hdl coder turned following chunk of vhdl:

y := '0';  k in 0 3 loop   y := y or key(k); end loop;  y_0 := '0' & '0' & '0' & '0' & '0' & '0' & '0' & y; 

which don't get. can me figure out what's going on here?

to understand this, have understand matlab sum logical inputs , native option. sum of logicals logical. sum replaced or

sum([true,true],'native') 

and coder puts out. for-loop implements sum (sum(key, 'native')), coder recognizes implemented using or.

finally, conversion logical uint8 done padding 7 0 bits.


Comments

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -