cristiancristea00

CID - Sumator 8 biți

Apr 12th, 2021
740
155 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module test_sumator_8biti_cristea;
  2.  
  3.    reg     [7:0]    A_sig;
  4.    reg     [7:0]    B_sig;
  5.    reg              C_IN_sig;
  6.    wire             C_OUT_sig;
  7.    wire    [7:0]    SUM_sig;
  8.  
  9.  
  10.    sumator_8biti_cristea DUT
  11.    (
  12.       .A(A_sig),
  13.       .B(B_sig),
  14.       .C_IN(C_IN_sig),
  15.       .C_OUT(C_OUT_sig),
  16.       .SUM(SUM_sig)
  17.    );
  18.  
  19.    initial begin
  20.       $monitor("%d + %d + %d = %d", A_sig, B_sig, C_IN_sig, {C_OUT_sig, SUM_sig});
  21.  
  22.       A_sig    = 8'b0101_1111; // 95
  23.       B_sig    = 8'b1001_0001; // 145
  24.       C_IN_sig = 0;
  25.  
  26.         #15;
  27.  
  28.       A_sig    = 8'b1111_1001; // 249
  29.       B_sig    = 8'b1001_1000; // 152
  30.       C_IN_sig = 0;
  31.  
  32.         #15;
  33.  
  34.       A_sig    = 8'b1011_1001; // 185
  35.       B_sig    = 8'b1001_0100; // 148
  36.       C_IN_sig = 1;
  37.  
  38.         #15;
  39.  
  40.       A_sig    = 8'b0001_1101; // 29
  41.       B_sig    = 8'b0101_1111; // 95
  42.       C_IN_sig = 1;
  43.  
  44.         #15;
  45.  
  46.       A_sig    = 8'b1111_1111; // 255
  47.       B_sig    = 8'b1111_1111; // 255
  48.       C_IN_sig = 1;
  49.  
  50.         #15;
  51.    end
  52.  
  53. endmodule
  54.  
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×