Tuesday, September 29, 2009
Microprocessors 9-28-09
The updated and working LED program Dr. Pollard wrote is located here: the only difference is nop's
The link to the in class exercise is here:
Basically what we reviewed was receiving data in the RX FIFO, as well as spitting that data back out in the TX FIFO
Friday, September 25, 2009
Microprocessors 9-24-2009
Things to remember:
a 1 written to the offset of 4 to the memory location of the LED's tells the DDR it's in "input mode" a 0 written tells it its in output mode.
Writing to the DREG will turn the LED's On or Off once you put the register in output mode.
Note: the above program wasn't working in class, I'll be posting an updated version tonight that works (somewhat different then the version we did in class)
Here is the updated file that works, here:
One thing to note is that you'll want to copy and paste the contents of these files into a new file, I had issues getting it to compile until I just copied over.
DDR means Data Direction Register.
DREG means Data Register.
Sunday, September 20, 2009
Microprocessors 9-17-2009
The example below takes a list of 1000 numbers generated from a random number generator from 0-10,000, then in groups of 0-999, 1000,-1999, 2000....
# in class 9_17
# work on comparison and branch commands
.org 0x100
# clear out registers
li r1, 0
li r2, 0
li r3, 0
li r4, 0
li r5, 0
li r6, 0
li r7, 0
li r8, 0
li r9, 0
li r10, 0
li r11, 0x200
li r12, 1000
mtctr r12
loop: lhz r13, 0(r11)
cmpi 3, 0, r13, 999 # P303 for cmpi
bt 13, chk2 # bit 12 is less then, 13 is greater then, bit 14 is equal, 15 summary overflow
addi r1, r1, 1
b nextv
chk2: cmpi 3, 0, r13, 1999
bt 13, chk3 # bit 12 is less then, 13 is greater then, bit 14 is equal, 15 summary overflow
addi r2, r2, 1
b nextv
chk3: cmpi 3, 0, r13, 2999
bt 13, chk4 # bit 12 is less then, 13 is greater then, bit 14 is equal, 15 summary overflow
addi r3, r3, 1
b nextv
chk4: cmpi 3, 0, r13, 3999
bt 13, chk5 # bit 12 is less then, 13 is greater then, bit 14 is equal, 15 summary overflow
addi r4, r4, 1
b nextv
chk5: cmpi 3, 0, r13, 4999
bt 13, chk6 # bit 12 is less then, 13 is greater then, bit 14 is equal, 15 summary overflow
addi r5, r5, 1
b nextv
chk6: cmpi 3, 0, r13, 5999
bt 13, chk7 # bit 12 is less then, 13 is greater then, bit 14 is equal, 15 summary overflow
addi r6, r6, 1
b nextv
chk7: cmpi 3, 0, r13, 6999
bt 13, chk8 # bit 12 is less then, 13 is greater then, bit 14 is equal, 15 summary overflow
addi r7, r7, 1
b nextv
chk8: cmpi 3, 0, r13, 7999
bt 13, chk9 # bit 12 is less then, 13 is greater then, bit 14 is equal, 15 summary overflow
addi r8, r8, 1
b nextv
chk9: cmpi 3, 0, r13, 8999
bt 13, chk10 # bit 12 is less then, 13 is greater then, bit 14 is equal, 15 summary overflow
addi r9, r9, 1
b nextv
chk10: addi r10, r10, 1
b nextv
nextv: addi r11, 0x2
bdnz loop
nop
here: b here
Oddly enough, the spacing on the blog doesn't take so all the lines are left aligned, sorry.
Wednesday, September 16, 2009
Speeding things up
For example, let's say you want to add a list of files to a filebox, that down the line the user will be using to open the files and use. There are a couple of things to think about here, we can load the files in the filebox and just let the user have at them, this can pose a potential problem if the file doesn't exist when you try to open it, rather then check each file as you add it to the file box, and make sure it exists first. You can do the check on each file as you attempt to open it, this way if the user only ends up using 5 files out of the entire box for this duration you only check to see that 5 files exist, rather then say the 100 other ones that they didn't use.
Another thing to do is let the user attempt to do certain actions if the action succeeds then continue on your way, but if the action fails rather then posting an error and stopping the program essentially, you just notify the user hey that action didn't work but here is what we're doing to recover from it, this thought alone can save you boatloads of time as well, rather then having to check each corner case, allow the user/program to do something that might cause an error, and simply know how to recover.
Aside from optimizing your code to reduce the number of checks how are you speeding things up for the end user?
Wednesday, September 9, 2009
IT lockdown
Check out the below link
http://portableapps.com/
I'm using notepad++ rather then notepad and vim!!!
Also I installed Firefox, winmerge and putty.
So why the collection of files?
Working out of my pendrive and compiling and doing other work is rather slow and doesn't work well in these labs.
Using WinMerge makes sure that and changes I make to the local copy can be verified and merged into the ones on my pen drive (So what I like to keep my old files)
Using Notepad++ is just nicer then using regular old notepad, and well you cant actually install notepad++ on the local machines so this gets around it.
Of course firefox, because I'm not an IE fan at all
and putty incase I have my server at home on and i want to SSH into it (not sure if SSH is blocked on these machines yet.
I can't even us the windows key and R to run the calculator... it just says that that has been locked down, want to know what day it will be on the 24th of december, no such luck looking at the calendar is locked down as well....terrible!!!
I'll update this post as I come up with more "workarounds" for this lab,
Friday, September 4, 2009
Alien Language
If you don't want to see the solution (in perl) don't look at my code, but here it is I'll explain it below.
Quick overview of the problem:
The first line of input contains 3 integers, L, D and N separated by a space. D lines follow, each containing one word of length L. These are the words that are known to exist in the alien language. N test cases then follow, each on its own line and each consisting of a pattern as described above. You may assume that all known words provided are unique.My solution:
while (chomp($read_line = <>))
{
@settings = split(/\s/, $read_line);
for ($i = 0; $i < $settings[1]; $i++)
{
chomp($item = <>);
push(@items, $item);
}
for ($i = 0; $i < $settings[2]; $i++)
{
chomp($testCase = <>);
$counter = 0;
foreach $word (@items)
{
$testCase =~ s/\(/\[/g;
$testCase =~ s/\)/\]/g;
if ($word =~ m/$testCase/i)
{
$counter++;
}
}
$caseNumber = $i + 1;
print "Case #$caseNumber: $counter\n";
}
}
Basically we grab the first line, and look for the 3 numbers, grab the second one to determine the number of lines we drop down for our test cases, then the 3rd number to grab the actual tests, then we just make it a regular expression, worked pretty quick, I know at least on the large dataset I had over 3:41 remaining, (maybe more) from when I downloaded it, to when I completed the upload. Worked pretty quick
Wednesday, September 2, 2009
Google Books
Which led me to finding a particular example of a site using javascript to generate a little table of books, after looking at it, I can simply use that java scripting to generate the link to books, I decided to try the book we're using in class and what do you know, there is a limited preview here:
That's kinda neat, so basically a guy could write a script that grabs all the isbns from a particular csv file and format a page that looks something like this.Test Page
Take a look at the source and see what you can do with it.
Source Pulled from this site: Google Example Dynamic Links
Tuesday, September 1, 2009
ECE 321 Electronics
Analysis and Design of Digital Integrated Circuits
ECE 344: Microprocessors
The example below takes a list of 1000 numbers generated from a random number generator from 0-10,000, then in groups of 0-999, 1000,-1999, 2000....Microprocessors 9/24
Things to remember:Microprocessors 9/28
a 1 written to the offset of 4 to the memory location of the LED's tells the DDR it's in "input mode" a 0 written tells it its in output mode.
In class today we reviewed the LED problem from last class, then we moved on to rs232 programming.Microprocessors 10/1-10/7
Here are the in class examples that we've covered in class since the 28thHow to Microprocessor
For someone that walks into this lab unprepared it can look like a lot, but for some that's a challenge and for other's that's an active barrier, rather then choosing to be prepared for it, you just walk through and hope for the best.Design and Programming..a Love affair
If you design your project well, looking at all possibilities up front without coding a single thing you can catch some problems up front that you may run into. One of those may cause messy or unneeded code! That's again the beauty of the artist they can choose whether they want to keep repainting the exact same thing or really go out there and paint something new!Concepts, the Leonardo of Programming
If you don't understand "what" you're trying to do, it's going to be very difficult to write code and/or tests for it.Syntax
Syntax doesn't require a whole lot of explaining. Mainly get a good source of information that you can understandTroubleshooting
In comes typical troubleshooting without a debugger, normally you stick some print statements in there and wait for the print fest to begin.
Sunday, August 23, 2009
Mountain Talks: Guitar Hero
We constantly "claim" we LOVE to do a particular thing, but time and again we find that we manage to avoid that area not because we want to, but more out of pure laziness. It's alot easier to sit down and watch tv, or play guitar hero.
While we were talking about that I began to say some words that have come to haunt me, why is it I can play the EXACT same song on Guitar Hero OVER and OVER trying to become "perfect" at it, yet while studying for a class I do a problem, get it finished (right or wrong doesn't matter at this point) and I'm willing to say, "I did it once that's all I need to do", but why doesn't that hold true for Guitar Hero, I played song x once, that is all I need to do, but I don't I try and try to succeed more and more. I mean I can get a perfect on Guitar Hero and even at that point, rather then saying ok NOW I've managed to do it perfect, I say hmm...I wonder if I can do it 2 times, or heck, why not keep trying to do it until I get it perfect EVERY time.
Now Mr. Smith and I have begun to use Guitar Hero as a constant reminder to do what we love, and not to just stop after doing something once, but to keep doing it over and over until we can do it perfect, and if we've managed to do it perfect, shoot go for perfect EVERY time.
So my goal for this semester is not to submit to this laziness, but rather then thinking about things as "passive" and "active" barriers to what I want to do, I'm going to be proactive about everything, no more sitting around and saying ahhh I need to relax, fine I can relax but rather then relax doing something I many times have come to loathe, I will "relax" doing something I'm passionate about.
Let me know what keeps you out of ruts, and what keeps you reaching for your passion and never giving up, or even what your stumbling blocks are.
Tuesday, August 18, 2009
Alarm Clock
I was thinking that it would be nice to be able to setup the alarm to shut off the display from time x to time y, with a button that you can hit to see the time (turns on the display), but basically the alarm would light up about 10 minutes before you have to get up, and then you will know what time it is,
Additionally, really do we need to know what time it is during the hours we're not at home? why not have the clock setup to shutdown or whatever until the time you get home, heck why not all appliances that can do it (obviously some like the fridge wouldn't work so well), but just have clocks that sync with network time (or something like that) and never have to set a clock again, and never have to see a clock at night again.
Shoot why not add wake on lan to all of them, then setup a website that will send a message to your clock, to turn on and then sound the alarm, there are probably tons of bad reasons why not to do this but ahhh whatever, anyways then if the lan is dead, then the clock just turns on (still keeps it's own time) and the last alarm set would be the new alarm..
Saturday, August 15, 2009
New Icon/Image
Here is my icon, I'm starting my business slowly, but hey who knows:
Let me know what you think of it, I just kinda threw it together kinda quickly.
If you have any ideas or want to send some submissions, send them to onaclov2000 at gmail dot com.
Thanks for checking it out, I'll post a few more if I think of any.
Friday, August 14, 2009
Mobility

In comes Cloud Computing, where your software is all located in the cloud, that's fine and great but we're still in the old age of working on one computer at a time. Let's say you have a Desktop computer at home, a laptop computer, and a computer at work, now if all these computers can start working in unison, we can do things like tell the laptop to broadcast it's location to your desktop, and if your laptop leaves where the desktop is, have it ask you if you'd like to continue working on what you were, or simply allow that laptop to be an "extension" of your current computer desktop, and literally DRAG your program that you're currently using onto that desktop, now you already have your environment open running and no more "save, shutdown, open wait" business.
Since all the data is stored in the cloud (and I'll assume autosaving is occuring), simply treating each computer as an extension of another we can seamlessly move what we're working on from one computer to another.
So right now linux has the neat function of "multiple desktops" why not setup each desktop as a vnc or something connection, so if we say "send to desktop x" it literally moves the program off your computer (passes off the processing) and into the next desktop (aka computer), now you can access each desktop from each computer, and move from device to device.
Why would we want this, lets say I'm deep into a project and want to continue as I'm on my way to work (say I use the bus), so I drag the program to the new desktop and walk away, I could maybe have things setup to shut down (obviously completely customizable), now I'm on my way to work and keep working on the project, I get to work and transfer directly to my desktop and continue as I finish, now I don't have to worry about closing the program and keeping on re-opening (waiting for programs to load).
What would be interesting if is if processors would continue processing what they are able to, but search for other processors (not on their board), once they find one, they communicate and setup shared processing (heck why waste cycles), now that it's sharing the processing, moving a program from one desktop should be nothing to do.
Wednesday, August 12, 2009
GV FAQ
ve any questions, I'll gladly post my answers.I had my sister txt me at my GV number and it came up someSo here is the story, basically, the text message goes to google, then
wild number, with her number in the txt message itself. So....its like
I get a message from 405 xxx xxxx and I have no idea who it is. I named
it "google" just to see, and had my other sister txt me and it was a
different (but very similar) number. Is that how it works? I'm
guessing it goes through google, and google is actually the one txting
me correct? If so, how do you know who is txting you? There is no way
I am remembering everyones numbers.
Google checks to see if the number is a contact, if so it will stick
their name in the text otherwise they stick the number in the message, then send you the contents of the text message.
Unfortunately that appears to be the only way that it works as of this
point, so basically expect to get some crazy number, but it'll have the
person's name or number (depending on if they are a contact yet or not),
now when you respond, you simply respond to that number, (just by
hitting reply), once you've done that, I imagine google parses the
initial portion (containing name or number) and sends them a text
message from your google number (oddly enough)
So basically if you have their number in google contacts you'll know
who's contacting you, fortunately I was so worried about losing my phone
and contacts that I had already had my google contacts updated by the
time this came along, now apparently there is a way to upload the phone
book to google contacts (via CSV), and that being the case you can
export your phone's contacts via CSV, the only toughie, is converting
one to the other,You might be able to convert using perl or some such script and then all you have to do is upload it to google, and you're golden.
The other odd thing is, I haven't told anyone else this new number, andFrom the looks of things, google voice customers texting to other
I've been txting all kinds of people and no one has really said
anything...like "who is this" when they get my txt. As far as I know,
they don't see anything different - just like its txting from my regular
number. And on the google voice page there are only the conversations
ive had with you, and when I had my sisters txt me. I don't think that
you are in my contact list, and when you txt me it comes up as the new
number I put in your phone?
It seems it treats google voice members differently? So it does not
give me a random number with you, even though you are not in my
contacts.
customers will see the google voice number come across, as far as
texting other people, unless you text them "through" your google voice
number, you are still literally using your number, it doesn't
automatically take your texts when you send them and send them through
GV.
The problem with "regular" phones, is if you want to call/text
someone through Google voice, using your phone (and not replying to a
text), you will have to call your google number (not sure how yet, I'll
have to look it up) then from there tell it who to call, so it's kinda a
pain unless you have a smart phone and can use an app, I.E. if you have
your ipod touch setup (jailbroken not that you would do that), you might be able to make that work, or Android and Blackberry already have apps in place.
What I've "been" doing is I'll go to the site and click call next to a
contact (or you can type in a number) then tell it which phone to ring,
then your phone will ring and then you will be connected with the
outgoing call to the number you wanted to call.
So what does that mean?
Basically if you don't have a smart phone, calling and texting (from
your phone) is a PIA, (except texts where you have already received one
on your phone), from the web interface it's pretty slick.
Hmmm, it seems like most of this google voice thing is a pain in the assSo what is the benefit of a Google Voice number?
- and I don't really see where the benefit is. But its fun enough to
play around with though and txt people through the interwebs and they
won't know who it is.
- One phone number that you keep and you don't have to worry about "transferring" from carrier to carrier.
- Central number that can call any/all of your phones, much like calling a 1-800 number to get ahold of a company and then they route you through the system to the proper phone, you now have this ability, nice if you have co-workers, friends and family constantly calling you can route them, or setup call schedules for different phones (see call schedule post).
- I can't stand texting from my phone, but frequently have an internet connection so I can use the much nicer keyboard from my iPod or even my desktop to handle this cumbersome task (for my phone anyways)
- You get to pick your number, basically if you can think of one, try searching for it, and you can have it if you find it, most carriers just give you a choice of a couple numbers (terrible).
- Call Schedules.
- Voicemail transcription, It still needs work, but if it transcribes your messages close enough you can get a gist of it, and know if you really want to listen to that 2.5 minute VM, or have a good enough idea after a few words what it's all about.
- LOGS! I occasionally like to have record of conversations with people GV does this multiple ways, one you can record conversations (haven't tried this yet), SMS logs, and Voicemail logs, no more having to store your max text messages and deleting only one when you need to receive a new text, once you have your text at your phone, it's already logged in GV, also no more WAITING for your current carrier's VM system to give you all kinds of useless info wasting your time and more importantly your minutes.
- Telemarketer "spam" abilities. So if the only number you give out is your GV number, it doesn't matter if a telemarketer calls you, all you have to do is add them to your contacts (Say a SPAM contact) and setup the special routing of that one to go to a special voicemail that says "the number you are trying to reach is out of service", no more/ very little telemarketers from now on.
There are more I'm sure but this is a good start.
GV: How to Set Custom Ring Schedules
Where do you go to that dictates what times certain phones will ring? I’m trying to figure that outLet's say you only want one phone to ring on the weekends and one to ring during the week, but only during the hours 9-5, how do you do that? Simple, use custom ring schedules.
Here's how:
1. Login to Google Voice
2. Click Settings
3. Click Phones
4. Click Edit on the phone you want to set a custom ring schedule for
5. Click Show Advanced Settings
As you can see, you can set the ring schedules to a particular time.

For this phone, I have the weekdays set to 9-5, and the weekends to not ring,
Now you simply would save and edit the other phone to only ring on weekends, by clicking "Always ring on weekends" and then clicking "Never ring on weekdays".
There you have it, a phone that rings only from 9-5 during the week only, and another that rings only on the weekends.
Let me know how you use Google Voice in the Comments.
Wednesday, August 5, 2009
All things Google: Google Voice
Another great thing is I can use my Ipod Touch to send and receive messages (in wireless hotspots), which means no more typing using my cellphone (not a keyboard, lets just leave it at that).
So I've been trying to come up with some ideas, I realize now that if I can manage to mashup my Google Calendar (Birthday event reminders), and Google Voice, I can now send Happy Birthday Texts automatically, and send myself a reminder that I did so....how cool would that be.
For those of you wondering Google Voice is kinda like having a central call center (one number) that can route different kinds of calls to different places, very convienient.
On the plus side I had all my google contacts in order (because I lost my enV back in the winter snowboarding), and because the iPod Touch can sync with the contacts and calendar I was set when I signed up, so now it's a simple search for a contact, then click call or sms, and if you call, it will prompt you for which phone to call from, so what it will do is call your phone first, then start the ringing for the other phone (kinda like a "transfer"), SWEET.
Anyways, the more I play with Google Voice the more I like, I'll try to continue a review at some point in the future!
Biggest drawback though at this point is that GV won't accept MMS messages.
I'll update if that changes
Thursday, July 30, 2009
All Things Google: Google Business Cards
Anyone know what the wait time from requesting an invitation to getting an invite is at this point?
Let me know how you use Google Voice in your daily life!
EDIT: I got them and they're pretty cool looking, I'll post pics of the card when I get a chance!
Class Search
Along came the idea of "class search", I'll give you a bit of a hint of what it's got, and as I continue working on it I'll bring it up a little more.

Right now my goal is to have a particular user login, and once they're logged in it will display classes that are relevant to their particular declared degree. The basic site I've currently made is an Comp Engineering Major related list of classes.
There are alot of "enhancements" that I am working on and have ideas for quite a few more.
You can check out the "mobile" version (updated most recently) here
If anyone knows any good "how to's" on using Google Calendar on their site, let me know!
Hope you like it.
Tuesday, July 28, 2009
Circuit Analysis II Lecture 22
Disclaimer: This series of posts is to serve as notes for myself as well as any others interested in the subject of Circuit Analysis II. This is the course ECE 213 at UNM.The course will follow the book:
Electric Circuits (8th Edition)
Final Review:
Solve for power across the resistor.
You are given the equation:
ak = (vm/k(pi))sin(k(pi)/2) and bk = (vm/k(pi))(1-cos(k(pi)/2))
When looking at k = 3 (Third harmonic) we find that the a3 and b3 will come out to -vm/3(pi) and positive
So for example when vm = 1 and RL = 15ohms
We can get An by just taking the co-efficients of the cos and sin from above and solve the equation .5 * An2/RL
We can plug into the equation:
(((1/3(pi)2 + 1/3(pi)2).5)2)/30
Solving that equation we get .75mW (since we're looking for power)
Now this method only works if we're looking for the power across a resistor on our output.
Also from the last quiz we were trying to decide what to do with 21.99 well converting to s domain and whatnot we basically get A from A|H(jw)|cos(wt+phi)
so plugging in 0 (where w = 0) into H(0j) we get 4/5 so since cos(0) = 1 we get A*4/5 which ends up being around 17.something
Good luck on the final!
Start at the beginning Lecture 1 6/8/09
Learning Ada
Yesterday I learned how to declare a record and how to assign values to the items in the record, there are 2 ways (that I currently know of).
Pertaining to a record that contains the items animal and fish:
1. Assign individually:
Albuquerque.animal := ("cow");
Albuquerque.fish := ("trout");
2. Assign them as a group:
Albuquerque := (animal => "cow", fish => "trout");