genrating pseudo random numbers


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting genrating pseudo random numbers
# 1  
Old 04-26-2007
genrating pseudo random numbers

I want to generate the file in following format

--------------------------------------
mov t1, %r1
mov t2, %g1
mov t3, %o1
.
.
.
.
m times

add %r1, %g1, %o1
add %r2, %g2, %o2
.
.
.
n times

-------------------------------------------
here t1, t2, t3. .. .. etc. random numbers generated between 0 and 32 bit largest number. and %r1 in mov can be %r1-%r32, %g1-%g7, %o0-%o7, %i0-%i7, %l0-%l7 which can also be generated randomely but all should be different in every line . Same case is for all lines begining with add.

will it be possible with perl script??
# 2  
Old 04-26-2007
Also since %r1-%r32 .. etc are limited and are different for all lines the value of m and n will be less than 30.
# 3  
Old 04-26-2007
Quote:
%r1-%r32

is %r1 a seperate value
and %r32 a different value
basically both of them being random numbers

and should the random numbers generated as this to be subtracted and displayed ?
# 4  
Old 04-26-2007
hi it is not %r1-%r32, I mean to say %r1, %r2, %r3 ..... %r32. So I just wanted to generate for ex. mov t %r2 where t will be 32 bit random no. and %r2 is string which I also want to generate it randomely.
Sorry for confusion
# 5  
Old 04-27-2007
ok if this is not possible atleast you can help me with perl script to generate following file

--------------------------------
mov t1
mov t2
mov t3
...
..
..
.
mov tn

where t1, t2, t3, .... tn are pseudo random numbers whose value ranges from 0 to largest 32 bit number.
# 6  
Old 04-27-2007
What does "largest 32 bit number" mean? 4294967296? 2147483648?
# 7  
Old 04-27-2007
hi you can give me the script with both largest 32 signed as well as unsigned nos. . Also I want the script to be executed from file and result also dumped into a file.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Homework & Coursework Questions

Random numbers

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! Write a shell script that will take the sum of two random number? Ex: Random n1 +Random n2 = result i tries to write it but i had some dufficulties ... (3 Replies)
Discussion started by: renegade755
3 Replies

2. Shell Programming and Scripting

Auto Ftp pseudo random file

I have a script that generates a file which is my own incarnation of a date using the 'date' function (we'll call this script a). I would like that script to invoke my other script (script b) which contains my ftp info. Since I have yet to figure out a good way to use regular ftp (yes i can only... (6 Replies)
Discussion started by: DC Slick
6 Replies

3. Shell Programming and Scripting

Replace a random string of numbers

Hi Can someone help me with this one? I have string.. (PROC_PROC_ID == 12183) <--PID is dynamic and i want to replace the PID number with whatever PID from /opt/hpws/apache32_2/logs/httpd.pid file. i'm having problem since the PID on the string is dynamic. It may be 2-5 digits or more. ... (5 Replies)
Discussion started by: ryandegreat25
5 Replies

4. Programming

Random numbers in parent/child?

Hi I'm trying to generate random numbers both in parent process and the child process. But I get the same random number in both processes. Why doesn't it generate different numbers altough I seed random number generator? Here's my code: #include <stdio.h> #include <unistd.h> #include... (2 Replies)
Discussion started by: xyzt
2 Replies

5. Shell Programming and Scripting

Generating random numbers

Hi, I am having trouble with generating random numbers. can this be done with awk? So I have a file that looks like this: 23 30 24 40 26 34 So column1 is start and column2 is end. I want to generate 3 random #'s between start and stop: So the output will look like this: ... (9 Replies)
Discussion started by: phil_heath
9 Replies

6. Shell Programming and Scripting

Random Numbers - Perl

Hi Guys I have a script to find Ranomd numbers. But I want to make the file to produce more random. Could u guys help me plz. In this Script I have the code that generates random in for loop and the range I have specified in my %chromlength input and out put will be like this chrno start end... (3 Replies)
Discussion started by: repinementer
3 Replies

7. Shell Programming and Scripting

Random numbers from 0 to 1000

Hello All, I want to make a simple script which generate random number from 0 to 1000. and simply display it. Plz HELP!!!!!! Regards, Waqas Ahmed (2 Replies)
Discussion started by: wakhan
2 Replies

8. Solaris

pseudo: [ID 129642 kern.info] pseudo-device: vol0

Hi I have a system that gave me some messages on bootup that I was not used to seeing: pseudo: pseudo-device: vol0 genunix: vol0 is /pseudo/vol@0 these came with these: Feb 13 17:42:17 system1 eri: SUNW,eri0 : 100 Mbps full duplex link up Feb 13 17:42:21 system1sendmail: My unqualified... (0 Replies)
Discussion started by: mndavies
0 Replies

9. UNIX for Dummies Questions & Answers

Random numbers without repetition

Is anyone know some scripts to generate random number without repetition using bash; for example generate 10 different random numbers. Thanks (8 Replies)
Discussion started by: asal_email
8 Replies
Login or Register to Ask a Question