You are on page 1of 2

`timescale 1ns / 1ps

////////////////////////////////////////////////////////////////////////////////
//
// Company:
// Engineer:
//
// Create Date:
17:34:39 10/09/2011
// Design Name:
// Module Name:
Controlador
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
////////////////////////////////////////////////////////////////////////////////
//
module Controlador
(
input clk,
input en,
input [11:0] datoa,
input [11:0] datob,
output reg [11:0] datout,
output reg [7:0] address = 0,
output reg int1,
output reg int2
);
reg estado=0;
always @(posedge clk)begin
//Se quitaron las interrupciones de los condicionales y se colocaron aqu
i
int2<=0;
int1<=0;
if(en)begin
if (estado==0 && address<255)begin
address<=address+1;
datout<=datoa;
end
else begin
if (estado==0 && address==255)begin
int1<=1;
estado<=1;
address<=0;
datout<=datoa;
end
else begin
if(estado==1 && address<255)begi
n

address<=address+1;
datout<=datob;
end
else begin
int2<=1;
estado<=0;
address<=0;
datout<=datob;
end
end
end
end
end
endmodule

You might also like