Write a Verilog Code for a module "odd_1s_finder" to find out odd number of 1s in a 8 bit signal "data" it gets every clock "clk".
Whenever data has odd 1s, an event called "odd event", two outputs change: odd_1s_found is true, and a 32 bit counter odd_1s_counter is incremented by 1.
Example:
Write a top level module "quad_odd_1s_finder" it create 4 instances of "odd_1s_finder", it comprise of 1 another 34 bit counter to count total number "odd events" from all 4 instance at each clock edge.
For example in a given clock if 2 out of 4 instances had odd events, increment the top-level counter by 2, and if 3 odd events, increment it by 3 and so on.
Whenever data has odd 1s, an event called "odd event", two outputs change: odd_1s_found is true, and a 32 bit counter odd_1s_counter is incremented by 1.
Example:
If in a given clock cycle, data[7:0]=8'b0100001, you notice it has 2 1s. Since 2 is even number, therefore there are even number of 1s, so your odd_1s_found signal should be False or 0.
Now if data[7:0]=8'b0100011, odd_1s_found signal should be True or 1, given there are 3 1s in the data.
Write a top level module "quad_odd_1s_finder" it create 4 instances of "odd_1s_finder", it comprise of 1 another 34 bit counter to count total number "odd events" from all 4 instance at each clock edge.
For example in a given clock if 2 out of 4 instances had odd events, increment the top-level counter by 2, and if 3 odd events, increment it by 3 and so on.
