15.07.2013 Views

EECE 353: Digital Systems Design Lecture 10: Datapath ... - Courses

EECE 353: Digital Systems Design Lecture 10: Datapath ... - Courses

EECE 353: Digital Systems Design Lecture 10: Datapath ... - Courses

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Bit Counting Circuit<br />

Suppose we want to count the number of ‘1’s in a word.<br />

Algorithm to do this:<br />

B=0<br />

while (A ≠ 0) do<br />

if (a0 = 1) then<br />

B = B + 1<br />

end if<br />

right shift A<br />

end while<br />

Note 1: this isn’t VHDL or<br />

C, it just is pseudo-code<br />

to illustrate the algorithm.<br />

Note 2: We could write<br />

this in VHDL, but it would<br />

not be synthesizable. So,<br />

we have to design it using<br />

smaller processes (each<br />

one synthesizable)<br />

<strong>Lecture</strong> <strong>10</strong>, Page 18

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!