Rants, code, electronics and coffee

Friday, February 22, 2013

Github!

I made a Github account, where I will be posting all the schematics and code for the following projects, including for "Algorithm of the week" (which I plan on continuing; I have no idea why I stopped after one post). And to celebrate, I've already uploaded the Java code for Bubble sort. It's made as an Eclipse project, so if you dislike Eclipse, feel free to dig a little bit to get to the source.

Saturday, January 19, 2013

Yet again, (lack of) supplies strike back

My plan about making a computer out of an 8086 has gone down the toilet. No, it isn't the lack of data (I'll link it at the end of the post, it's pretty good) or lack of money, it's the fact that I can't get the most crucial component: the Intel 8086. Seems that you can't get them here in Serbia, unless you salvage them from somewhere, and that is an even worse problem. So, I'm kind of "rerouting" the project to use an ATMEGA16-16PU.

Yes, I know, it's RISC, but it seems much more fun to use. In the end, it will have the same stuff I wanted to implement in the Intel 8086. And the datasheet is amazing (both aesthetically and technically). And the price... the price is something about 4 Euros, when converted from Dinars to Euros.

Thinking of which, how about I make a homebrew ATMEGA16-16PU dev board? With LEDs and other bells and whistles and then build my own operating system for it. I should probably add a few expansion ports for it eg. extra RAM (it's possible; I don't need a gig of RAM, 512kB seems enough).

Can't wait to begin working on this.

8086 links:
http://www.parl.clemson.edu/~wjones/371/gowdy/documents/materials/8086Overview_OLD.pdf
http://www.old-computers.com/history/detail.asp?n=4&t=3
http://howardhuang.us/teaching/cs232/06-Intel-8086-architecture.pdf
http://www.cpu-world.com/CPUs/8086/index.html
http://www.scribd.com/doc/9755070/Microprocessor-8086
http://repository.binus.ac.id/content/H0182/H018279364.pdf
http://www.penguin.cz/~literakl/intel/intel.html

Wednesday, January 16, 2013

Need Photoshop? Illustrator? After Effects? Get them for free without the police knocking at your door

This is old news (in Internet time) because it was first announced/discovered about two weeks ago, but I'm going to share it anyway:

Adobe recently allowed people to download the WHOLE CS2 suite, for free, from their site. Although it is a bit old, it is pretty useful for people like me, who have a computer that hasn't been upgraded (except the graphics curd which burst in flames) for the last 5+ years.

Newer Mac users will be disappointed, since CS2 supports only PowerPC Macs (PowerPC was awesome, too bad they shut it down).

Here's the link if someone wants it:
http://www.adobe.com/downloads/cs2_downloads/index.html

Sunday, January 13, 2013

Back from the dead, it rises again

Sorry for the overly dramatic/poetic title, but I think it's adequate, considering I came back to this blog after over a month.

The thing is, I was busy. A lot. Girlfriend, university, and now the semester finals. No, they aren't over yet, I am writing this in my break between taking tests and sleeping.

I got a crazy idea 15 minutes ago, about making my own retro computer. Nothing fancy, an Intel 8086 and a Zilog Z80 (not on the same board of course). They'll be pretty basic, a few ROM/RAM chips and a serial connection. Maybe I'll add the VGA output later. But the first part in this "plan" is obtaining the datasheets on paper. I'll scour my city library in the following months for them, but in worst case, I'll shell out and print them.

Also, I started messing with my Stellaris Launchpad. Not much, just did a few exercises from the lab workbook and my first impression: wow. It's so simple to use, after you get used to the "want multiple stuff at once? Bitwise AND them". And I barely scratched into it. My ultimate goal is writing an AVR and a PIC programmer (sure beats buying a programmer for 20+ euros). Of course, the source code will be open and put on github.

I'll have time for all this from the middle of January, when I finish most of my university tests. Also, if all goes according to plan, February will be a working month :)

That's all for now, I'll make a new post later in the afternoon about some old news (where old means a week old).

Saturday, December 8, 2012

Algorithm of the week: Bubble sort (and sorting in general)

Instead of studying for a test tomorrow, I'll procrastinate usefully by refreshing my memory on bubble sort and sorting in general. Not a bad way to evade studying?

So, sorting is a process where a sequence of numbers gets rearranged into either a rising progression or into a falling progression (I do not know the correct terms, but you'll understand it in a bit).

Imagine you have a sequence of numbers: 3 7 2 4 9 1
If you would sort it to be a rising progression, it would look like this: 1 2 3 4 7 9
And if you would sort it to a falling progression, it would look like this: 9 7 4 3 2 1

Humans are naturally good at sorting numbers, but what happens with computers? What happens when we have a boatload of numbers that we (humans) can't sort easily? That's where sorting algorithms come.

A sorting algorithm is a set of instructions given to the computer with the intent to sort a sequence of numbers. Since we are talking about computers, there are lot ways to accomplish sorting, some more efficient with small sequences of numbers, and some more efficient with bigger sequences of numbers. Algorithm efficiency is defined as a property that tells us how the algorithm "responds" with increased input (in this case more numbers). I will dedicate a post in full about that (and the infamous Big O notation) in the course of a few days.

Now, enough theory, time to get our hands dirty: one of the most popular sorting algorithms is the bubble sort. It's called that way because numbers tend to "float to the surface" when you use it. The case for using bubble sort for a sequence of numbers that you want to be a rising progression is like this:
  1. Compare two numbers in sequence
  2. If the one on the left is greater than one the right, switch places
  3. If the one on the left is lower than the one on the right, do nothing
  4. Go back to step one, except now compare the second number in sequence and the one after it
See? Nothing special, but very useful. Here's an example with a sequence of four numbers:

  1. 3 1 7 2
  2. 1 3 7 2
  3. 1 3 7 2
  4. 1 3 2 7
  5. 1 3 2 7
  6. 1 3 2 7
  7. 1 2 3 7
  8. 1 2 3 7

Let's break it down:
  • On the first line we compared the first two numbers and concluded that the first one is lower than the second one
  • On the second line we wrote the conclusion from the first step and compared the second number and the third one, from which we concluded that they don't need to be re-arranged
  • On the third line we compared the third and fourth number and concluded that the third one is higher than the second one
  • On the fourth line we wrote the conclusion from the previous step. We don't have any numbers to compare our fourth one to: we have reached our first pass-through. Bubble sort can have a minimum of two pass-thoroughs: the first one to sort the sequence, and the second one to verify that no more numbers can be swapped.
  • On the fifth line we note that the first number is greater than the second one so we don't do anything
  • On the sixth line we conclude that the second number is higher than the third one, so we are going to swap them on the next line
  • On the seventh line we swap the numbers from the line before
  • And finally, we pass through the sequence without swapping, which means our sequence is sorted.
 Bubble sort is one of the most basic sorting algorithms, but it is only good for sorting small sequences of numbers and for learning the basics of sorting or when you need a quick and dirty way to sort something.

Sources:
http://en.wikipedia.org/wiki/Bubble_sort
http://stackoverflow.com/questions/276113/what-is-a-bubble-sort-good-for
http://en.wikipedia.org/wiki/Sorting_algorithm

Thursday, November 29, 2012

Obligatory "First post!"

Hi and welcome to my tech oriented blog, where I will post updates about my own projects (mostly about electronics and programing, sometimes even both) and occasionally a few tech rants (and a few non-tech rants). I'm not a blog oriented person (every blog I start tends to evaporate in a few weeks), but I will do my best to post fairly regularly.
Now, some more concise stuff I will be writing about: I am in the process of buying a new soldering iron and some other stuff, like a loupe with a third hand and a PCB etching kit, mostly because:
  1. My old soldering iron got clogged (I had a gas one, the worst 20e ever spent)
  2. I need to make some quick repairs around the house, for which I require a soldering iron
  3. I also want to get more into electronics (the practical kind, hence the projects) and
  4. I bought a Stellaris Launchpad while it was on preorder (nifty gadget, check it out )
 So, stick around, have a few beers, and wait for the first real post in the following weeks.