Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Apr 25th, 2013, 7:03 AM   #1
doctorzeus
Newbie
 
Join Date: Oct 2010
Posts: 3
Rep Power: 0 doctorzeus is on a distinguished road
Randomly Generate Two Numbers and Pass Through Logic Gate - ATMEGA8535

Hello all,

I have been working on this problem for weeks and have made only small amount of progress on the issues unfortunatly being a compleate noob at assembly ..

What I have been asked to write a program that generates two 8 bit random numbers (these have to be selected randomly from a table):

table: .DB $06,$5B,$4F,$66,$6D,$7D,$07,$7F,$6F,$77,$7C,$39,$5E,$79,$71,$BF,$86,$DB,$CF,$E6,$EE,$FD,$87,$FF,$E7,$F7,$FC,$B9,$DE,$F9,$F1

The numbers then need to be passed through one the of these logic gates (AND, NAND, OR, NOR or XOR).

If anyone can please give me some tips and/or examples of how to do this it would be greatly apreciated!

I am also having to program this on an ATMEGA8535 board..

Kind Regards

DoctorZeus
doctorzeus is offline   Reply With Quote
Old Apr 25th, 2013, 1:03 PM   #2
Ancient Dragon
Achieved Level 70

 
Ancient Dragon's Avatar
 
Join Date: Jun 2005
Location: near St Louis, MO. (USA)
Posts: 4,345
Rep Power: 10 Ancient Dragon will become famous soon enoughAncient Dragon will become famous soon enough
Re: Randomly Generate Two Numbers and Pass Through Logic Gate - ATMEGA8535

generate a number between 0 and the number of items in the table, then use that number s index into the table.

>I have been working on this problem for weeks

OMG! why didn't you just google for "random number generator in accembly". If found one answer in the very first link google produced.
__________________
PFO's FAQ is here
Forum Rules

There is no cow level (Diablo III)
If you never push yourself you will never improve (Diablo III)
Ancient Dragon is offline   Reply With Quote
Old Apr 26th, 2013, 7:04 AM   #3
doctorzeus
Newbie
 
Join Date: Oct 2010
Posts: 3
Rep Power: 0 doctorzeus is on a distinguished road
Re: Randomly Generate Two Numbers and Pass Through Logic Gate - ATMEGA8535

Quote:
Originally Posted by Ancient Dragon View Post
generate a number between 0 and the number of items in the table, then use that number s index into the table.

>I have been working on this problem for weeks

OMG! why didn't you just google for "random number generator in accembly". If found one answer in the very first link google produced.
Thanks for the reply!

The results on google are extremly platform dependent, and I have found little to no examples for my particular board (ATMEGA8535).

Also keep in mind I am very new to Assembly (started learning about a week ago).

I can show you example code of what I have so far if you want?

Kind Regards

DoctorZeus
doctorzeus is offline   Reply With Quote
Old Apr 26th, 2013, 10:41 AM   #4
sixstringartist
Programming Guru

 
Join Date: Jun 2005
Posts: 1,333
Rep Power: 13 sixstringartist will become famous soon enough
Re: Randomly Generate Two Numbers and Pass Through Logic Gate - ATMEGA8535

Is this an assignment? Is there a particular reason you're using assembly?

If so, it will likely be easier for you if you write it in C or pseudocode then translate your statements to blocks of asm instructions.
sixstringartist is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Pass by reference (Arrays) RabiatorProductions C 4 Mar 2nd, 2012 11:44 AM
a simple program to find median of x numbers poopysammich Java 7 Feb 13th, 2012 4:43 AM
Newbie problem with a code aspektor C 2 Sep 6th, 2010 9:48 PM
Numbers - Immutable + a few Qs NiGhtMarEs0nWax Python 4 Apr 21st, 2010 8:23 AM
Pass value into textbox and transmit fax tgallina Visual Basic .NET 2 Jan 12th, 2009 7:41 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 8:33 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC