Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Sumator 1 bitowy, który sumuje 2 bity.
- a, b to są bity, które sumujemy,
- cin to od carry input, co oznacza bit przeniesienia z poprzedniego,
- s to to suma dodawania (sum)
- cout to carry output, czyli bit przeniesienia dalej.
- */
- module Zadanie_1_sumator_1_bit_assign (input cin, a, b, // input - porty wejsciowe
- output s, cout); // output - porty wyjsciowe
- assign s = a ^ b ^ cin; // opis funkcji sumy
- /*
- Suma s powstaje przez 2 bramki xor (jedna dla a, b, druga dla wyniku (a, b)
- i Cin.
- */
- assign cout = a & b | (a ^ b) & cin; // opis funkcji przeniesienia
- endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement