From 85ba783a69052c5133fb76ae87e450303a4fd841 Mon Sep 17 00:00:00 2001 From: Jeevaha Coelho Date: Tue, 15 Dec 2020 05:21:37 -0800 Subject: [PATCH] Fixed signing error in alu and added excel file --- Instructions.xlsx | Bin 0 -> 14368 bytes rtl/mips_cpu_alu.v | 18 +++++++++--------- 2 files changed, 9 insertions(+), 9 deletions(-) create mode 100644 Instructions.xlsx diff --git a/Instructions.xlsx b/Instructions.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..2c17c4448d33feecdbb96151b9266c83a116b0ba GIT binary patch literal 14368 zcmeHu1y>x~()QpGB)BKI2X}XOcXzkJU4lC#I6;DBkl-%C-61%H;O=hUF)5!$e0xYt%BH$p6qEq6KN zf0Ftn9{jmXBeo_Xnmrd6`Q!w4x(-gRanXdqhV+G$0-L?|73)stxx$`EX@sCCMH}rl z2=Z?JfPb({8&a0W4cCOrGem_RUuIRawN;sgRfGI%rt2GZhLoFF8q6xCrrLWV>HVQ8 z%v}8{D?A=iA|dNCh!T4iA|%!@1k@^K%yVMPKv+hymFA&FmRH@2p1wv0lDN&;8x{3# zhL60#lL;~Exr(#Z9!)lz@rW1ct`~=F1BK<0^g}x4hYB|c&z`vEzE_U#K40JjjqeiY zFejXOwS~gFhM`)o09Koi&@KsG%OQ6W&Mq}LaZYg_Qc&V%xVYl876GXq#yE);JXc82 zK}d(9E>`o`F@$%eODHSZ`NBj$KAxcvJcIr09 z+qp6_{QCbt_xxY%lYhJQvLt!MZYHF#6RF4Wft%Tt1XK}O4`Hbm5;gxo>E+jTu?6G= zD;-pXsA~8jP?7;{{*OaTD}1s010>f!*~+5PF?q@AJ<7vU@15P?XenJjN;sFT_n^7Y zUd>*oOUigrySK&DmNu5;$qufONlc%KRiTbEXyPMa6cUDE^QQ;t^vP?ln%q`E%!;TU zm4{U}aOUnOk7owVeJt8T7L4GQJDf_#8gMnST&VCJup_y;!&g_e;t)x(L_&7#vMhvI>q^|Lr77 z?ll@;p#XqfaA!W+1+lN}x%9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B>@a zi9SF6Qoa15HWAsT;@Q&vS<_eiInWXooZ5DM{qXC+H>FxV>}(&#&cyb=&ok|4 z8gFFc_pGds_#ML^whx^GBB($yr=aq*_?v_inWqJ$JwW+J6|S!oQBRBtI?WSUn^9#NKfI2T_(IkVus zAG_(}c`qitLdauynK0R_6uFg;2?I@Fi*xI|TzI`5RqY-!IRL?TrPmU9FJABJ^j>S|I$idR;){joa@a!|GdzjQk zJ?e@?$mIoZZcm*(drM!b7EfDvgE=n&wWaT7C3i3i2Li}5{EjRSBxWla zmErfZ7adG|&l{KBSLfc!{tS2emaG(O&(+U}|2AI;NP6%x_n*IV`uBAGd;bsLJSoZk zC&7PyfAMeNuYEDtC;s*|#_z!2d(!`cj==s;OX9yf)PD#6XVdFnPynC=Ty6uG+WtQ+ zu)p*C-U;~^(-PAE2=QNik-xM2{-*6OmQMUXSbl%+_B+AvwZgv$gh>A&_^WdGJM{PJ z#b3}pia(*h*D`)*_&tgHi-DZ}cOCp=O7}bA?>W(5gp>?_5dM}C{bPpoJL!K$`oAav tfI>z9;J@Pj@9_V8Q2!lH!SXlwzaHC4vM^v91OSl0KT5C}Z?gS5`hRD#xZMB% literal 0 HcmV?d00001 diff --git a/rtl/mips_cpu_alu.v b/rtl/mips_cpu_alu.v index ba26f57..9f2d48e 100644 --- a/rtl/mips_cpu_alu.v +++ b/rtl/mips_cpu_alu.v @@ -5,7 +5,7 @@ module mips_cpu_alu( input logic [4:0] shamt, //5-bit input used to specify shift amount for shift operations. Taken directly from the R-type instruction (Non-Variable) or from output logic ALUCond, //If a relevant condition is met, this output goes high(Active High). Note: Relevant as in related to current condition being tested. - output logic signed[31:0] ALURes // The ouput of the ALU + output logic[31:0] ALURes // The ouput of the ALU ); /* @@ -77,19 +77,19 @@ Ops ALUOps; //Note confusing naming to avoid potential duplicate variable naming assign ALUOps = ALUOp; case(ALUOps) ADD: begin - ALURes = $signed(A) + $signed(B); + $signed(ALURes) = $signed(A) + $signed(B); end SUB: begin - ALURes = $signed(A) - $signed(B) ; + $signed(ALURes) = $signed(A) - $signed(B) ; end MUL: begin - ALURes = $signed(A) * $signed(B); + $signed(ALURes) = $signed(A) * $signed(B); end DIV: begin - ALURes = $signed(A) / $signed(B); + $signed(ALURes) = $signed(A) / $signed(B); end AND: begin @@ -121,11 +121,11 @@ Ops ALUOps; //Note confusing naming to avoid potential duplicate variable naming end SRA: begin - ALURes = $signed(B) >>> shamt; + $signed(ALURes) = $signed(B) >>> shamt; end SRAV: begin - ALURes = $signed(B) >>> A; + $signed(ALURes) = $signed(B) >>> A; end EQ: begin @@ -205,11 +205,11 @@ Ops ALUOps; //Note confusing naming to avoid potential duplicate variable naming end MULU: begin - ALURes = A * B; + $signed(ALURes) = $signed(A) * $signed(B); end DIVU: begin - ALURes = A / B; + $signed(ALURes) = $signed(A) / $signed(B); end endcase