data/full_repos/permissive/408955603/Sesion1/ej13.v
1: b'%Warning-WIDTH: data/full_repos/permissive/408955603/Sesion1/ej13.v:17: Operator ASSIGN expects 16 bits on the Assign RHS, but Assign RHS\'s VARREF \'reg8Signed\' generates 8 bits.\n                                                                      : ... In instance ej13\n  reg16Signed = reg8Signed;\n              ^\n                ... Use "/* verilator lint_off WIDTH */" and lint_on around source to disable this message.\n%Error: Exiting due to 1 warning(s)\n'
module ej13;
	reg [15:0] reg16;
	reg signed [15:0] reg16Signed;
	reg signed [7:0] reg8Signed;
	initial
	begin
		reg16 = 2323;
		$display ("Numero %d en un registro de 16bits\nHexadecimal : %h \nBinario : %b", reg16, reg16, reg16);

		reg16 = 16'b1111_1111_1111_1111;
		$display ("\n\nMayor numero en un registro de 16 bits sin signo. \nDecimal : %d \nBinario : %b \nHexadecimal : %h", reg16, reg16, reg16);

		reg16Signed = 6789;
		$display ("\n\nExpresion en binario del numero %d en un registro de 16bits con signo. \nBinario : %b", reg16Signed, reg16Signed);

		reg8Signed = -22;
		reg16Signed = reg8Signed;
		$display ("\n\nNumero %d en un registro de 8 bits y en uno de 16 bits. \n16Bits. \n\tDecimal : %d \n\tBinario : %b \n\n8Bits. \n\tDecimal : %d \n\tBinario : %b", reg8Signed, reg16Signed, reg16Signed, reg8Signed, reg8Signed);
	end
endmodule
module ej13;

	reg [15:0] reg16;
	reg signed [15:0] reg16Signed;
	reg signed [7:0] reg8Signed;
	initial
	begin
		reg16 = 2323;
		$display ("Numero %d en un registro de 16bits\nHexadecimal : %h \nBinario : %b", reg16, reg16, reg16);

		reg16 = 16'b1111_1111_1111_1111;
		$display ("\n\nMayor numero en un registro de 16 bits sin signo. \nDecimal : %d \nBinario : %b \nHexadecimal : %h", reg16, reg16, reg16);

		reg16Signed = 6789;
		$display ("\n\nExpresion en binario del numero %d en un registro de 16bits con signo. \nBinario : %b", reg16Signed, reg16Signed);

		reg8Signed = -22;
		reg16Signed = reg8Signed;
		$display ("\n\nNumero %d en un registro de 8 bits y en uno de 16 bits. \n16Bits. \n\tDecimal : %d \n\tBinario : %b \n\n8Bits. \n\tDecimal : %d \n\tBinario : %b", reg8Signed, reg16Signed, reg16Signed, reg8Signed, reg8Signed);
	end
endmodule