Advertisement
AbraaoAllysson

banco de registradores - upload

Jun 16th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void TestarRegistrador(){
  2.  
  3.         int Reg_a,Reg_b;
  4.            
  5.             AFFECT (inttostr(cur_vect), "clk", inttostr(clk) );
  6.             AFFECT (inttostr(cur_vect), "rst", inttostr(rst) );
  7.             AFFECT (inttostr(cur_vect), "D", inttoHstr(D) );
  8.             AFFECT (inttostr(cur_vect), "En", inttostr(En) );
  9.             if(c[0]==1)
  10.             {
  11.                 AFFECT (inttostr(cur_vect), "Reg_A", inttoHstr(0x00000000) );
  12.                 AFFECT (inttostr(cur_vect), "Reg_B", inttoHstr(0x00000000) );
  13.             }
  14.             else
  15.             {
  16.            
  17.                 for(n=0;n<32;n++)
  18.                 {
  19.                     a[n]= Q();
  20.                     Reg_a = Mux_32_1(ENTRADA);
  21.                     Reg_b = Mux_32_1(ENTRADA);
  22.                 }
  23.                
  24.              D = Reg_a;
  25.              D = Reg_b;
  26.              
  27.              AFFECT(inttostr(cur_vect), "Reg_A", inttoHstr(Q()));
  28.              AFFECT(inttostr(cur_vect), "Reg_B", inttoHstr(Q()));
  29.                
  30.                 }                                                      
  31.  
  32.            
  33.             clka = clk;
  34.             cur_vect++;
  35.             clk = !clk;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement