data/full_repos/permissive/433640910/MorseCode/morsecode.v
data/verilator_xmls/69155fef-0586-4a12-b73e-6cd2b08f337d.xml
module part3(ClockIn, Resetn, Start, Letter, DotDashOut);
	input ClockIn, Resetn, Start;
	input [2:0]Letter;
	output DotDashOut;
	reg [11:0]alphabet;

	wire Enable;
	wire [11:0]shift;
	reg rotationToLeft;

	
	always @(*)
		begin
			case (Letter[2:0])
				3'b000: alphabet = 12'b010111000000;
				3'b001: alphabet = 12'b011101010100;
				3'b010: alphabet = 12'b011101011101;
				3'b011: alphabet = 12'b011101010000;
				3'b100: alphabet = 12'b010000000000;
				3'b101: alphabet = 12'b010101110100;
				3'b110: alphabet = 12'b011101110100;
				3'b111: alphabet = 12'b010101010000;
				default: alphabet = 12'b010111000000;
			endcase
		end
	
	RateDivider u0(ClockIn, Resetn, Enable);
	
	always @(posedge ClockIn, negedge Resetn)
		begin 
			if(Resetn == 1'b0)
				rotationToLeft <= 1'b0;
			else if(Enable == 1'b1)
				rotationToLeft <= 1'b1;
			else
				rotationToLeft <= 1'b0;
		end
	
	shiftReg u1(ClockIn, ~Resetn, ~Start, ~rotationToLeft, 0, alphabet, shift, Enable);
	
	assign DotDashOut = shift[11];

endmodule
module part3(ClockIn, Resetn, Start, Letter, DotDashOut);

	input ClockIn, Resetn, Start;
	input [2:0]Letter;
	output DotDashOut;
	reg [11:0]alphabet;

	wire Enable;
	wire [11:0]shift;
	reg rotationToLeft;

	
	always @(*)
		begin
			case (Letter[2:0])
				3'b000: alphabet = 12'b010111000000;
				3'b001: alphabet = 12'b011101010100;
				3'b010: alphabet = 12'b011101011101;
				3'b011: alphabet = 12'b011101010000;
				3'b100: alphabet = 12'b010000000000;
				3'b101: alphabet = 12'b010101110100;
				3'b110: alphabet = 12'b011101110100;
				3'b111: alphabet = 12'b010101010000;
				default: alphabet = 12'b010111000000;
			endcase
		end
	
	RateDivider u0(ClockIn, Resetn, Enable);
	
	always @(posedge ClockIn, negedge Resetn)
		begin 
			if(Resetn == 1'b0)
				rotationToLeft <= 1'b0;
			else if(Enable == 1'b1)
				rotationToLeft <= 1'b1;
			else
				rotationToLeft <= 1'b0;
		end
	
	shiftReg u1(ClockIn, ~Resetn, ~Start, ~rotationToLeft, 0, alphabet, shift, Enable);
	
	assign DotDashOut = shift[11];

endmodule