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

Subversion Repositories openmsp430

[/] [openmsp430/] [trunk/] [core/] [rtl/] [verilog/] [omsp_alu.v] - Diff between revs 117 and 134

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 117 Rev 134
Line 34... Line 34...
//
//
// *Author(s):
// *Author(s):
//              - Olivier Girard,    olgirard@gmail.com
//              - Olivier Girard,    olgirard@gmail.com
//
//
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
// $Rev: 117 $
// $Rev: 134 $
// $LastChangedBy: olivier.girard $
// $LastChangedBy: olivier.girard $
// $LastChangedDate: 2011-06-23 21:30:51 +0200 (Thu, 23 Jun 2011) $
// $LastChangedDate: 2012-03-22 21:31:06 +0100 (Thu, 22 Mar 2012) $
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
`ifdef OMSP_NO_INCLUDE
`ifdef OMSP_NO_INCLUDE
`else
`else
`include "openMSP430_defines.v"
`include "openMSP430_defines.v"
`endif
`endif
Line 91... Line 91...
 
 
function [4:0] bcd_add;
function [4:0] bcd_add;
 
 
   input [3:0] X;
   input [3:0] X;
   input [3:0] Y;
   input [3:0] Y;
   input       C;
   input       C_;
 
 
   reg   [4:0] Z;
   reg   [4:0] Z_;
   begin
   begin
      Z = {1'b0,X}+{1'b0,Y}+{4'b0,C};
      Z_ = {1'b0,X}+{1'b0,Y}+{4'b0,C_};
      if (Z<5'd10) bcd_add = Z;
      if (Z_<5'd10) bcd_add = Z_;
      else         bcd_add = Z+5'd6;
      else          bcd_add = Z_+5'd6;
   end
   end
 
 
endfunction
endfunction
 
 
 
 

powered by: WebSVN 2.1.0

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