OpenCores
URL https://opencores.org/ocsvn/vtach/vtach/trunk

Subversion Repositories vtach

[/] [vtach/] [trunk/] [usum.v] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 wd5gnr
`timescale 1ns / 1ps
2
 
3
/* Unsigned BCD sum */
4
module usum(input [16:0] a, input [12:0] b, output [16:0] z);
5
  wire c0, c1, c2, c3;
6
  digitadd add1(a[3:0],b[3:0],1'b0,z[3:0],c0);
7
  digitadd add2(a[7:4],b[7:4],c0,z[7:4],c1);
8
  digitadd add3(a[11:8],b[11:8],c1,z[11:8],c2);
9
  digitadd add4(a[15:12],b[12]?4'h9:4'h0,c2,z[15:12],c3);
10
  assign z[16]=a[16]+b[12]+c3;
11
 
12
endmodule

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.