Skip to content

Instantly share code, notes, and snippets.

@yuhei1horibe
Last active April 29, 2019 01:33
Show Gist options
  • Select an option

  • Save yuhei1horibe/a31c73e7bb888e86f5e0e7d4386ddec4 to your computer and use it in GitHub Desktop.

Select an option

Save yuhei1horibe/a31c73e7bb888e86f5e0e7d4386ddec4 to your computer and use it in GitHub Desktop.
// Add user logic here
wire [4:0]out_from_adder;
// Assign result
always @( posedge S_AXI_ACLK)
begin
if (S_AXI_ARESETN == 1'b0 )
begin
output_reg <= 32'h00000000;
end
else
begin
output_reg <= {27'h0, out_from_adder[4:0]};
end
end
// Wire adder
adder4 ADDER_1(
.a (input_a_reg[3:0]),
.b (input_b_reg[3:0]),
.y (out_from_adder[4:0]));
assign LED_OUT[7:0] = { 3'h0, out_from_adder[4:0] };
// User logic ends
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment