Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- `timescale 1ns / 1ps
- //////////////////////////////////////////////////////////////////////////////////
- // Company:
- // Engineer:
- //
- // Create Date: 03.08.2018 15:02:23
- // Design Name:
- // Module Name: calculadoradysplay
- // Project Name:
- // Target Devices:
- // Tool Versions:
- // Description:
- //
- // Dependencies:
- //
- // Revision:
- // Revision 0.01 - File Created
- // Additional Comments:
- //
- //////////////////////////////////////////////////////////////////////////////////
- module calculadoradysplay(
- input logic [15:0] OP1,
- input logic [15:0] OP2,
- input logic [1:0] operacion,
- input logic CLK100MHZ,
- output logic [7:0] D7S,
- output logic [7:0] AN
- );
- logic [31:0]SW = {OP2,OP1};
- logic [7:0] output_an;
- logic [7:0] output_7s;
- logic [8:0] resultado;
- logic [31:0] dsp_num;
- logic [31:0] def_output = {8'b0, SW[7:0], 8'b0, SW[15:8]};//$$$$$$$
- alu4 ALU (
- .button(operacion),
- .numeroA(SW[15:0]),
- .numeroB(SW[31:16]),
- .resultado(resultado)
- );
- drv_7seg DRV7SEG(
- .in_num(dsp_num),
- .clk(CLK100MHZ),
- .D7S(D7S),
- .AN(AN)
- );
- always_comb
- begin
- if (SW == 4'b0001 || SW == 4'b0010 || SW == 4'b0100 || SW == 4'b1000)
- dsp_num = {23'b0, resultado};
- else
- dsp_num = def_output;
- end
- endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement