Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

32 bit to 128bit and output in 32bit + 100 points for soluti

Status
Not open for further replies.

khamitkar.ravikant

Member level 4
Member level 4
Joined
Jul 15, 2008
Messages
78
Helped
6
Reputation
12
Reaction score
2
Trophy points
1,288
Location
India
Activity points
1,798
32 to 128bit data path

i am implementing encryption algo.
as 128 bits data is taken inside with data path of 32 bits.
the 4 clock cycle needed are designed using state machine.
but one extra cycle of clock get wasted during state trasition to laod the count
so please any body can suggest me the better solution.

i am taking in 128 bit data using 32 bit word line inside and then after storing in temp
registger, after 4 clock cycles 128 bit data is processed so there is no problem with shift rows operation,
package is included and inner is main flow.

in image it is shown the extra clock requiring wich i want to avoid to take data in and
ctout is output in 32 bit from 128 bit processed output.

please do somebody help me out.

the code is given as attachment

 

Re: 32 bit to 128bit and output in 32bit

Hi Ravi,
CAn you make a 128 bit register or fifo inside your processor...

then shifht the parallel data by 32 bit on every tic of clock..

Cheers,
Tom
 
32 bit to 128bit and output in 32bit

hi tom
thanks for reply as i have given code and i need to make this code synchronus for 4 clock cycles and as it is taking 5 clock cycle at each conversion so i need to know is it possible to eliminate extra clock cycle number 5 for every conversion of 128 bit which i am using for counter loading with value of initial.
 

32 bit to 128bit and output in 32bit

Hi Ravi,
check the signal "cnt" this goes beyond the range , as you defined it as from 0 to 3. try to fix it. hope this will solve your problem.
 
32 bit to 128bit and output in 32bit

the cnt problem is right but i am not finding proper solution
please any alternative for this.....
 

Re: 32 bit to 128bit and output in 32bit + 100 points for so

khamitkar.ravikant said:
/.../one extra cycle of clock get wasted during state transition/.../

when your cnt = 0 the fsm enters the state 'idle', the state 'idle'
keeps cnt = 3 for one clock cycle;
remove the fsm, it's not necessary and control the data flow
with the counter value only;

I haven't tried to understand your data manipulation, but
when reading the code my first impression was - it can be
done simpler, without all these <signal>, <signal_next>,
<signal_before> etc;
---
 
Re: 32 bit to 128bit and output in 32bit + 100 points for so

my version of the code, slightly simplified, may be someone is interested;
quartus reported less resources usage and higher Fmax then the original code;
Code:
module inner 
( 
  input             clk, rst, 
  input      [31:0] din, 
  output reg [31:0] dout 
); 

reg  [ 1:0] cnt; 

always @(posedge clk) 
  if ( rst )  cnt <= 0; 
  else        cnt <= cnt + 1; 

reg [31:0] arr[2:0];       
reg [31:0] arr_out[3:0];

always @(posedge clk) 
  case ( cnt )
    0, 1, 2 : begin arr[cnt] <= din; dout <= arr_out[cnt]; end 
    
    3 : begin                                           
          arr_out[0] <= {arr[0][31:24],arr[1][23:16],arr[2][15:8],   din[7:0]}; 
          arr_out[1] <= {arr[1][31:24],arr[2][23:16],   din[15:8],arr[0][7:0]}; 
          arr_out[2] <= {arr[2][31:24],   din[23:16],arr[0][15:8],arr[1][7:0]}; 
          arr_out[3] <= {   din[31:24],arr[0][23:16],arr[1][15:8],arr[2][7:0]}; 
             dout    <= arr_out[3];                          
        end    
  endcase 
  
endmodule
---
 
Re: 32 bit to 128bit and output in 32bit + 100 points for so

Hi khamitkar.ravikant,

i think if ur counter comes to zero and again goes to 3 and wastes one clock(important for counting),u can check for when ur counter comes to zero, load it with value 2 not 3 and at same time perform ur first 32 bit input task and then continue with ur normal routine.

Maybe this will help.

For any doubts and my mistakes, u r always welcome.

Best of Luck
Geeks
 
Hi khamitkar.ravikant,

Can u update us abt the status of ur design.

Can i help at any other point.

And just for my info. on which encryption algorithm u r working on? And for which company r u working.

Regards
Geeks
 

Re: 32 bit to 128bit and output in 32bit + 100 points for so

I am interested at this but i cannot find your code....... =.=
 

Re: 32 bit to 128bit and output in 32bit + 100 points for so

yes i removed the code as i got the solution for same on my own
still somebody if interested then please do send me private message i will let them know where code is. and will discuss the code in detail too.
 

Hi ravikant,
can u pls share ur solution to us.

Regards
Geeks
 

khamitkar.ravikant what is the software you use for simulation and waveform? your waveform looks very nice..
 

its xilinx ISE software only that is XST simulator inbuilt inside xilinx software, the image i uploaded is with software version of Xilinx ISE 8.2 and now i am using Version 10.1 i
so simulator is XST only and to have great details of simulation now i statrted using Modelsim 6.0d also
thanks and regards
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top