`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company: 
// Engineer: 
// 
// Create Date:    10:02:35 04/20/2020 
// Design Name: 
// Module Name:    mult_module 
// Project Name: 
// Target Devices: 
// Tool versions: 
// Description: 
//
// Dependencies: 
//
// Revision: 
// Revision 0.01 - File Created
// Additional Comments: 
//
//
//
//////////////////////////////////////////////////////////////////////////////////
module	DataMuxer	
#(	
	parameter	DataWidth	=	256,
	parameter	CmdWidth	=	3
)
(
	input	Rst_i,
	input	Clk_i,
	
	input	[CmdWidth-1:0]	MuxCtrl_i,
	
	input	[DataWidth-1:0]	MeasData_i,
	input	[DataWidth-1:0]	OscData_i,
	
	input	MeasDataVal_i,
	input	OscDataVal_i,
	
	output	reg	[DataWidth-1:0]	MuxDataOut_o,
	output	reg	MuxedVal_o
);	

//================================================================================
//  CODING
	
	always	@(posedge	Clk_i)	begin
		if	(!Rst_i)	begin
			if	(MuxCtrl_i==1)	begin
				MuxDataOut_o	<=	OscData_i;
				MuxedVal_o		<=	OscDataVal_i;
			end	else	begin
				MuxDataOut_o	<=	MeasData_i;
				MuxedVal_o		<=	MeasDataVal_i;
			end
		end	else	begin
			MuxDataOut_o	<=	0;
			MuxedVal_o		<=	0;
		end
	end
	
endmodule











