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

Subversion Repositories t6507lp

[/] [t6507lp/] [trunk/] [rtl/] [verilog/] [t6507lp_alu.v] - Diff between revs 142 and 145

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

Rev 142 Rev 145
Line 165... Line 165...
                        begin
                        begin
                                alu_status[Z] <= STATUS[Z];
                                alu_status[Z] <= STATUS[Z];
                                alu_status[V] <= alu_a[6];
                                alu_status[V] <= alu_a[6];
                                alu_status[N] <= alu_a[7];
                                alu_status[N] <= alu_a[7];
                        end
                        end
                        INC_ZPG, INC_ZPX, INC_ABS, INC_ABX, DEC_ZPG, DEC_ZPX, DEC_ABS, DEC_ABX :
                        INC_ZPG, INC_ZPX, INC_ABS, INC_ABX, DEC_ZPG, DEC_ZPX, DEC_ABS, DEC_ABX, ASL_ZPG, ASL_ZPX, ASL_ABS, ASL_ABX :
                        begin
                        begin
                                alu_result <= result;
                                alu_result <= result;
                                alu_status <= STATUS;
                                alu_status <= STATUS;
 
 
                        end
                        end
                        default : begin
                        default : begin
                                //$display("ERROR");
                                //$display("ERROR");
                        end
                        end
                endcase
                endcase
Line 389... Line 388...
                                STATUS[V] = 0;
                                STATUS[V] = 0;
                end
                end
 
 
                // ASL - Arithmetic Shift Left
                // ASL - Arithmetic Shift Left
                ASL_ACC : begin
                ASL_ACC : begin
                        {STATUS[C],result} = A << 1;
                        //{STATUS[C],result} = A << 1;
 
                        {STATUS[C],result} = {A,1'b0};
                end
                end
                ASL_ZPG, ASL_ZPX, ASL_ABS, ASL_ABX : begin
                ASL_ZPG, ASL_ZPX, ASL_ABS, ASL_ABX : begin
                        {STATUS[C],result} = alu_a << 1;
                        //{STATUS[C],result} = alu_a << 1;
 
                        {STATUS[C],result} = {alu_a,1'b0};
                end
                end
 
 
                // LSR - Logical Shift Right
                // LSR - Logical Shift Right
                LSR_ACC: begin
                LSR_ACC: begin
                        {result, STATUS[C]} = A >> 1;
                        //{result, STATUS[C]} = A >> 1;
 
                        {result,STATUS[C]} = {1'b0,A};
                end
                end
                LSR_ZPG, LSR_ZPX, LSR_ABS, LSR_ABX : begin
                LSR_ZPG, LSR_ZPX, LSR_ABS, LSR_ABX : begin
                        {result, STATUS[C]} = alu_a >> 1;
                        //{result, STATUS[C]} = alu_a >> 1;
 
                        {result,STATUS[C]} = {1'b0,alu_a};
                end
                end
 
 
                // ROL - Rotate Left
                // ROL - Rotate Left
                ROL_ACC : begin
                ROL_ACC : begin
                        {STATUS[C],result} = {A,alu_status[C]}; //TODO: does it really work?
                        {STATUS[C],result} = {A,alu_status[C]}; //TODO: does it really work?

powered by: WebSVN 2.1.0

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