Guest User

Untitled

a guest
Jan 12th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module part6(input Clock_50, output [0:6] HEX7, HEX6, HEX5, HEX4, HEX3, HEX2, HEX1, HEX0);
  2.     reg [2:0] A;
  3.     reg [25:0] Q;
  4.     always @ (posedge Clock_50) begin
  5.         if (Q < 49999999) Q <= Q + 1;
  6.         else begin
  7.             Q <= 26'd0;
  8.             A <= A + 1;
  9.         end
  10.     end
  11.     HELO_Decode HD0 (A + 3'd0, HEX4);
  12.     HELO_Decode HD1 (A + 3'd1, HEX3);
  13.     HELO_Decode HD2 (A + 3'd2, HEX2);
  14.     HELO_Decode HD3 (A + 3'd3, HEX1);
  15.     HELO_Decode HD4 (A + 3'd4, HEX0);
  16.     HELO_Decode HD5 (A + 3'd5, HEX7);
  17.     HELO_Decode HD6 (A + 3'd6, HEX6);
  18.     HELO_Decode HD7 (A + 3'd7, HEX5);
  19. endmodule
  20.    
  21. module HELO_Decode (input [2:0] A, output [0:6] H);
  22.     assign H[0] = A[1]|(~A[2]&~A[0])|(A[2]&A[0]);
  23.     assign H[1] = A[1]|A[0];
  24.     assign H[2] = A[1]|A[0];
  25.     assign H[3] = (A[2]&A[1])|(A[2]&A[0])|(~A[2]&~A[1]&~A[0]);
  26.     assign H[4] = (A[2]&A[1])|(A[2]&A[0]);
  27.     assign H[5] = (A[2]&A[1])|(A[2]&A[0]);
  28.     assign H[6] = A[2]|A[1];
  29. endmodule
Add Comment
Please, Sign In to add comment