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

Subversion Repositories 8051

[/] [8051/] [trunk/] [rtl/] [verilog/] [oc8051_alu.v] - Diff between revs 171 and 178

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

Rev 171 Rev 178
Line 44... Line 44...
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
//
//
// CVS Revision History
// CVS Revision History
//
//
// $Log: not supported by cvs2svn $
// $Log: not supported by cvs2svn $
 
// Revision 1.17  2003/06/09 16:51:16  simont
 
// fix bug in DA operation.
 
//
// Revision 1.16  2003/06/03 17:15:06  simont
// Revision 1.16  2003/06/03 17:15:06  simont
// sub_result output added.
// sub_result output added.
//
//
// Revision 1.15  2003/05/07 12:31:53  simont
// Revision 1.15  2003/05/07 12:31:53  simont
// add wire sub_result, conect it to des_acc and des1.
// add wire sub_result, conect it to des_acc and des1.
Line 224... Line 227...
      des_acc = mulsrc1;
      des_acc = mulsrc1;
      des1 = src1;
      des1 = src1;
      des2 = mulsrc2;
      des2 = mulsrc2;
      desOv = mulOv;
      desOv = mulOv;
      desCy = 1'b0;
      desCy = 1'b0;
      desAc = 1'bx;
      desAc = 1'b0;
      enable_mul = 1'b1;
      enable_mul = 1'b1;
      enable_div = 1'b0;
      enable_div = 1'b0;
    end
    end
//operation divide
//operation divide
    `OC8051_ALU_DIV: begin
    `OC8051_ALU_DIV: begin
      des_acc = divsrc1;
      des_acc = divsrc1;
      des1 = src1;
      des1 = src1;
      des2 = divsrc2;
      des2 = divsrc2;
      desOv = divOv;
      desOv = divOv;
      desAc = 1'bx;
      desAc = 1'b0;
      desCy = 1'b0;
      desCy = 1'b0;
      enable_mul = 1'b0;
      enable_mul = 1'b0;
      enable_div = 1'b1;
      enable_div = 1'b1;
    end
    end
//operation decimal adjustment
//operation decimal adjustment
Line 264... Line 267...
    `OC8051_ALU_NOT: begin
    `OC8051_ALU_NOT: begin
      des_acc = ~src1;
      des_acc = ~src1;
      des1 = ~src1;
      des1 = ~src1;
      des2 = 8'h00;
      des2 = 8'h00;
      desCy = !srcCy;
      desCy = !srcCy;
      desAc = 1'bx;
      desAc = 1'b0;
      desOv = 1'bx;
      desOv = 1'b0;
      enable_mul = 1'b0;
      enable_mul = 1'b0;
      enable_div = 1'b0;
      enable_div = 1'b0;
    end
    end
//operation and
//operation and
//bit operation and
//bit operation and
    `OC8051_ALU_AND: begin
    `OC8051_ALU_AND: begin
      des_acc = src1 & src2;
      des_acc = src1 & src2;
      des1 = src1 & src2;
      des1 = src1 & src2;
      des2 = 8'h00;
      des2 = 8'h00;
      desCy = srcCy & bit_in;
      desCy = srcCy & bit_in;
      desAc = 1'bx;
      desAc = 1'b0;
      desOv = 1'bx;
      desOv = 1'b0;
      enable_mul = 1'b0;
      enable_mul = 1'b0;
      enable_div = 1'b0;
      enable_div = 1'b0;
    end
    end
//operation xor
//operation xor
// bit operation xor
// bit operation xor
    `OC8051_ALU_XOR: begin
    `OC8051_ALU_XOR: begin
      des_acc = src1 ^ src2;
      des_acc = src1 ^ src2;
      des1 = src1 ^ src2;
      des1 = src1 ^ src2;
      des2 = 8'h00;
      des2 = 8'h00;
      desCy = srcCy ^ bit_in;
      desCy = srcCy ^ bit_in;
      desAc = 1'bx;
      desAc = 1'b0;
      desOv = 1'bx;
      desOv = 1'b0;
      enable_mul = 1'b0;
      enable_mul = 1'b0;
      enable_div = 1'b0;
      enable_div = 1'b0;
    end
    end
//operation or
//operation or
// bit operation or
// bit operation or
    `OC8051_ALU_OR: begin
    `OC8051_ALU_OR: begin
      des_acc = src1 | src2;
      des_acc = src1 | src2;
      des1 = src1 | src2;
      des1 = src1 | src2;
      des2 = 8'h00;
      des2 = 8'h00;
      desCy = srcCy | bit_in;
      desCy = srcCy | bit_in;
      desAc = 1'bx;
      desAc = 1'b0;
      desOv = 1'bx;
      desOv = 1'b0;
      enable_mul = 1'b0;
      enable_mul = 1'b0;
      enable_div = 1'b0;
      enable_div = 1'b0;
    end
    end
//operation rotate left
//operation rotate left
// bit operation cy= cy or (not ram)
// bit operation cy= cy or (not ram)
    `OC8051_ALU_RL: begin
    `OC8051_ALU_RL: begin
      des_acc = {src1[6:0], src1[7]};
      des_acc = {src1[6:0], src1[7]};
      des1 = src1 ;
      des1 = src1 ;
      des2 = 8'h00;
      des2 = 8'h00;
      desCy = srcCy | !bit_in;
      desCy = srcCy | !bit_in;
      desAc = 1'bx;
      desAc = 1'b0;
      desOv = 1'bx;
      desOv = 1'b0;
      enable_mul = 1'b0;
      enable_mul = 1'b0;
      enable_div = 1'b0;
      enable_div = 1'b0;
    end
    end
//operation rotate left with carry and swap nibbles
//operation rotate left with carry and swap nibbles
    `OC8051_ALU_RLC: begin
    `OC8051_ALU_RLC: begin

powered by: WebSVN 2.1.0

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