This has not been a great week for me. This post was SUPPOSED to be a tutorial for making fluorescent lightbulbs run on batteries. The problem being, of course, that two months and entirely too much solder into the project, my lightbulb remains unlit. Sigh. So, instead I turned to finish Chapter Four, which describes the Hack machine language you'll be using in your computer. It only has two projects at its end, so I figure I can read through it quickly and finish before I start studying for finals.
This was before I realized that in Chapter Four, ECS throws all of its rational explanations and helpful examples out the window in exchange for a list of machine language commands whose functions remain a mystery after reading the chapter three times. I didn't actually finish this project on my own. I found solutions others had programmed and studied them in order to figure out what the code actually did. And this was after studying the Hack tutorial on the Nand2Tetris website and the forums. I'll do my best to explain my problems with the chapter, but considering I'm still not sure I understand it, the explanation may not be accurate.
The first issue I encountered was in their initial explanation of machine language. Their explanation uses syntax from some language other than Hack, which was very confusing.
Then they go on to their explanation of the machine's two memory registers: A, which holds information that can be used in a command as either an address or a value, and D, which only holds values. These registers are manipulated through an @ command. The @ command is not well explained at all. The book seems to say that it works like a pointer in the A register. Actually, it loads a value into the A register. Consider this code.
@R1 // This loads the word "R1" into some space in the A register
D = M // M refers to whatever is currently loaded in the A register, in this case R1
// D is the D register, which is unaffected by @ commands, so it can store values that are
// used by multiple @ commands.
@x // This loads the word "x" into some space in the A register
M = D // In a higher level language, this would translate to x = R1.
// The program will now read R1 everywhere you type x
Some 'memory words' (a term not defined in the book, meaning "R1" or "SCREEN" if those point to a specific memory address.) appear to be predefined addresses, but these are never listed. One of the projects involves creating multiple loops, but the syntax for loop creation is never given. At one point the chapter detours to describe how C commands translate into binary, which is both useless for the project and intensely confusing. You have to clear each memory register before you use it, but are never told to do so. The list goes on and on.
I don't understand how others were able to create their projects from this chapter. I may have done an exceptionally terrible job with the reading and missed everything I needed to know. I've never used machine language before. I had no context for how it should work. After hours of study, I was able to recreate others' solutions for the projects, and I understand the language enough now to use it. But did it really have to be that difficult?
I'm also a bit concerned that there was no chapter where we created the Assembler and CPU (unless those are created in chapter 5 and we just skipped around a bit.) I understand that they may be too complicated for the course to include, I was just expecting to build the ENTIRE computer, not just the parts of it that were convenient.
Hopefully I'll find Chapter 5 easier to understand. It probably didn't help that it was the week before finals too, and every teacher assigned every project at once. The upside is, expect project posts soon! I've got two on mindstorms and one on tech theatre costumes as soon as they get back from the school.
Then it's on to summer! And summer means robots and space camp, so you know what? Chapter Four? Still worth it for getting me that much closer to having my computer BUILT.
See you next time!
Saturday, May 31, 2014
Friday, May 30, 2014
Feature Friday: Solar Roadways
I come across more and more REALLY COOL THINGS that people have designed and made every day. Really cool things that I want to share with you guys, and that I think definitely deserve the publicity. I've decided to pick a project, plan, or product every week that I want to share the sheer awesomeness of.
This week, let's talk about the recently crowd-funded Solar Roadways.
A company run by a couple, Julie and Scott Brenshaw, Solar Roadways promises to bring clean energy to the streets. The two have developed a modular solar grid system, and they plan to cover every sidewalk, highway, and streetside across America that's been wasting away under the beaming sun. It's a far fetched plan for clean energy, but it's raised 1.6 million on indieagogo already, and the funding keeps coming.
This week, let's talk about the recently crowd-funded Solar Roadways.
A company run by a couple, Julie and Scott Brenshaw, Solar Roadways promises to bring clean energy to the streets. The two have developed a modular solar grid system, and they plan to cover every sidewalk, highway, and streetside across America that's been wasting away under the beaming sun. It's a far fetched plan for clean energy, but it's raised 1.6 million on indieagogo already, and the funding keeps coming.
Not only that, the couple proposes that their durable solar panels be equipped with LEDs to create light up symbols and warnings on the road, heating, to melt snow on the road, powering electric cars as they drive, and so much more.
The solar roadways project is incredible because it is able to tie in so many under realized technologies (solar panels, electric cars, etc.) I would give you the numbers, but I think it's more effective if they do it themselves. Their fundraiser was so successful, it was extended for another two weeks. Everyone should take a look at this project, because it might be the future of our roads. "Walking on Sunshine" indeed.
Sunday, May 11, 2014
The Elements of Computing Systems, Chapter 3
Finished Chapter 3, all about memory and sequential computer chips. This chapter was generally easier than chapter 2 in my opinion, mostly because all except for one of the chips were just bigger, badder versions of others. Making RAM4k isn't any fundamentally different from making RAM512, so you can't breeze through each of those chips easily. Which is good, because the outlier chip, the counter, was the most difficult chip I found to implement so far.
Unlike the ALU, where my problems were born of my own poor decision making skills, the sequential chips are just more difficult to design. They require a different kind of thinking than the combinatorial chips, because you have to account for past values emitted by the chip and compare them to the value the chip is receiving now. Be ready to make good use of your multiplexers.
The counter itself is particularly difficult for two reasons. One, unless you take the time to look at the test and the .cmp files for the counter, it can be difficult to understand the structure you're aiming for in the chip. Two, the structure itself is complicated, and relies heavily on the order of the gates. I used the debugging flag tool in the software for the first time for the counter, and I was very happy with how it worked, considering I did a LOT of debugging over the course of the chip. If you have trouble, remember its called a sequential chip for a reason. Figure out the order things should be calculated first, then go from there.
Unlike the ALU, where my problems were born of my own poor decision making skills, the sequential chips are just more difficult to design. They require a different kind of thinking than the combinatorial chips, because you have to account for past values emitted by the chip and compare them to the value the chip is receiving now. Be ready to make good use of your multiplexers.
The counter itself is particularly difficult for two reasons. One, unless you take the time to look at the test and the .cmp files for the counter, it can be difficult to understand the structure you're aiming for in the chip. Two, the structure itself is complicated, and relies heavily on the order of the gates. I used the debugging flag tool in the software for the first time for the counter, and I was very happy with how it worked, considering I did a LOT of debugging over the course of the chip. If you have trouble, remember its called a sequential chip for a reason. Figure out the order things should be calculated first, then go from there.
- Also, the tests for the memory related chips can take forever to complete. If you aren't specifically debugging a certain section of the program, run the test with no animation, otherwise you may be sitting there for ten minutes.
Monday, May 5, 2014
Elements of Computing Systems, Chapter 2
Chapter Two took me significantly longer to finish than chapter one, but mostly because I decided to get cheeky with the software. Just because you can do something doesn't necessarily mean you should in the interest of efficiency or mental health preservation.
The second chapter focuses on translating the gates you've already made into the manipulation of binary numbers. As your project you build Adders, and Incrementers, and finally, your computer's Arithmetic Logic Unit, a chip for doing simple mathematical calculations using two 16 bit binary inputs.
This section's background information is shorter than the last, but before you start the projects at the end of the chapter, I highly, highly HIGHLY recommend that you read the entire appendix, telling you all about the software and the programming language. Read it through. Read it twice. Learn how to use the software and the language , because when it comes time to use the ALU, it can be hard to distinguish between which problems are caused by syntax and which are caused by misunderstanding the concepts.
Like I mentioned before, while working on the ALU I got a little cocky, and decided to start designing my own chips and tests to deconstruct the problem. Two hours of hair pulling later, I find out the book has a section devoted to designing tests (although it specifies that a students really shouldn't need to do so in their projects). I discovered that my problem had to do with typing the wrong number of spaces in my .cmp file. Other fun problems included: linking the ALU's OUT pins to an component chip, making an internal pin with a value of zero, and figuring out the difference between negating a binary number and making a binary number negative. These were all problems that could have easily been avoided had I read the appendix before starting the programming. Still, I feel that much more accomplished.
Another good resource is the forum. It's still very active, and there are plenty of people there willing to help with problems. They have a strict policy of not outright stating an answer, which I think is great, but I did notice that could sometimes leave the questioner be guzzled if someone was withholding information that would make it 'too easy.' So it shouldn't be your only resource, but I am 100% pro internet collaboration, and it appears to work well for this project. I'll be sure to set up an account for chapter 3.
With my ALU finally functional and a lot more HDL know-how under my belt, I'm ready to press forward and onward in the world of binary logic. Chapter 3 awaits!
The second chapter focuses on translating the gates you've already made into the manipulation of binary numbers. As your project you build Adders, and Incrementers, and finally, your computer's Arithmetic Logic Unit, a chip for doing simple mathematical calculations using two 16 bit binary inputs.
This section's background information is shorter than the last, but before you start the projects at the end of the chapter, I highly, highly HIGHLY recommend that you read the entire appendix, telling you all about the software and the programming language. Read it through. Read it twice. Learn how to use the software and the language , because when it comes time to use the ALU, it can be hard to distinguish between which problems are caused by syntax and which are caused by misunderstanding the concepts.
Like I mentioned before, while working on the ALU I got a little cocky, and decided to start designing my own chips and tests to deconstruct the problem. Two hours of hair pulling later, I find out the book has a section devoted to designing tests (although it specifies that a students really shouldn't need to do so in their projects). I discovered that my problem had to do with typing the wrong number of spaces in my .cmp file. Other fun problems included: linking the ALU's OUT pins to an component chip, making an internal pin with a value of zero, and figuring out the difference between negating a binary number and making a binary number negative. These were all problems that could have easily been avoided had I read the appendix before starting the programming. Still, I feel that much more accomplished.
Another good resource is the forum. It's still very active, and there are plenty of people there willing to help with problems. They have a strict policy of not outright stating an answer, which I think is great, but I did notice that could sometimes leave the questioner be guzzled if someone was withholding information that would make it 'too easy.' So it shouldn't be your only resource, but I am 100% pro internet collaboration, and it appears to work well for this project. I'll be sure to set up an account for chapter 3.
With my ALU finally functional and a lot more HDL know-how under my belt, I'm ready to press forward and onward in the world of binary logic. Chapter 3 awaits!
Sunday, April 27, 2014
The Elements of Computing Systems, Chapter One
As a programmer and a maker, I think it's important to understand how computers work on all levels. I'm incredibly jealous of people who can build computers in games like Little Big Planet or Minecraft, because it's something I'd love to learn how to do. My dad showed me this book, and we decided to work through it together.
Even though you might worry that the information might be a little dated, coming all the way from 2005, the information is fundamental in a way that hasn't changed yet. Each chapter is divided up into various sections that will give you background information you need to complete the 'project' at the end of each chapter. The end result is using a chip design software that comes bundled with the book to build your own computer and use a higher-level language to program a game on it.
The first chapter introduces logic gates. I cannot stress enough how useful the background information is. As someone whose only experience with logic gates has been basic redstone built circuits in mine craft a year ago, and who's only taken programming courses through week long camps or online that don't delve into hardware at all, the information was invaluable. It was easy to read, although I'd recommend having wikipedia ready to clear up any misunderstandings if you aren't familiar with some of the terminology.
The chapter ends by asking you to design each of the basic chips it mentioned (AND, OR, XOR, etc.) in the bundled software design program using only NAND gates. It gives you a short hint as to making each one, which pretty much boils down to HINT: READ THE BACKGROUND INFORMATION ALREADY. Using the design program is simple enough. Each chip you have to design comes with three files: .hdl, the actual chip, .tst, the test script for that chip, and .cmp, the logic table the test script uses to test the chip. The test and logic table scripts come premade, but you have to drag the .hdl file to Textmate, or whatever you use, to program in the chip using their Hardware Development Language. It's very simple to learn, especially if you're used to programming.
Here's the kicker: Once you've programmed and tested a chip, if it works, you can use it in building other chips. For example, if you've successfully made your AND chip, you can use it directly in your OR chip instead of having to use two NANDs all over again. It gives you a feeling of building up your computer that's very satisfying.
Bonus: If you just aren't getting it with the programming language, you can always build a bunch of nand gates in mine craft and go from there.
I certainly liked this course enough to move on to chapter two. It does a great job of teaching, and even if the projects can be difficult, the give me a sense of accomplishment and understanding. But if you don't know anything about programming, try a programming 101 course first. It will help you have an easier time with the terminology and the design software when you get into the real meat of things
Even though you might worry that the information might be a little dated, coming all the way from 2005, the information is fundamental in a way that hasn't changed yet. Each chapter is divided up into various sections that will give you background information you need to complete the 'project' at the end of each chapter. The end result is using a chip design software that comes bundled with the book to build your own computer and use a higher-level language to program a game on it.
The first chapter introduces logic gates. I cannot stress enough how useful the background information is. As someone whose only experience with logic gates has been basic redstone built circuits in mine craft a year ago, and who's only taken programming courses through week long camps or online that don't delve into hardware at all, the information was invaluable. It was easy to read, although I'd recommend having wikipedia ready to clear up any misunderstandings if you aren't familiar with some of the terminology.
The chapter ends by asking you to design each of the basic chips it mentioned (AND, OR, XOR, etc.) in the bundled software design program using only NAND gates. It gives you a short hint as to making each one, which pretty much boils down to HINT: READ THE BACKGROUND INFORMATION ALREADY. Using the design program is simple enough. Each chip you have to design comes with three files: .hdl, the actual chip, .tst, the test script for that chip, and .cmp, the logic table the test script uses to test the chip. The test and logic table scripts come premade, but you have to drag the .hdl file to Textmate, or whatever you use, to program in the chip using their Hardware Development Language. It's very simple to learn, especially if you're used to programming.
Here's the kicker: Once you've programmed and tested a chip, if it works, you can use it in building other chips. For example, if you've successfully made your AND chip, you can use it directly in your OR chip instead of having to use two NANDs all over again. It gives you a feeling of building up your computer that's very satisfying.
Bonus: If you just aren't getting it with the programming language, you can always build a bunch of nand gates in mine craft and go from there.
I certainly liked this course enough to move on to chapter two. It does a great job of teaching, and even if the projects can be difficult, the give me a sense of accomplishment and understanding. But if you don't know anything about programming, try a programming 101 course first. It will help you have an easier time with the terminology and the design software when you get into the real meat of things
Make a Heated Cat Hammock
This was a quick weekend project I whipped together for my cat, who's gotten more arthritic and ornery the older she gets. She took up the habit of lying on my Mom's heated throw blanket and biting people whenever we moved her, so I built this as a peace offering.
Parts:
Four 1/2" Dowels, cut to 8" long
One 15" diameter round wood thing
Two approx 18" squares of fleece
A heating pad
Four 1" screws
A screwdriver
A drill
A 1/2" drill bit
Power
Instructions:
First drill the four holes into the base of the hammock. Each hole should be about 1.5" away from the edge of the base, and should make a square as shown. Drill in at an ANGLE of about 60 degrees, and stop when you hit the bottom.
Next go ahead and attach a screw into each dowel. The screw should stick out about a half inch , so that it can be used to mount the hammock. I place my screws about 3/4" down the dowel, but it can be moved up for larger cats or down for smaller ones, so long as each screw is about the same height on the dowel.
Next slide the dowels into the base. You can use glue if you want, but I found that mine didn't need it. Make sure that the screws face away from the base.
Cut strips about 1" wide and 2" long down each side of your fleece squares. Line them up and knot them together on three sides, pretty side out. If you're having trouble, look at these instructions.
Slip the heating pad through the remaining open side. I had to fold mine in half. Make sure the power cord is still accessible, then knot the remaining side closed. Mount the hammock by slipping one corner knot over each dowel. You may have to stretch the fleece to do this. The knot will stop sliding at the screw, so that your heated cat hammock sits suspended and comfy.
If I come back to this project later, I think I'll add a primitive pressure sensor and wire it to a relay, so that I don't have to turn on the heating pad when the cats climb in - it'll turn on all by itself. To do that, though. I would need a different heating pad, or I'd just need to rewire the controls on this one, which requires you to press a button to turn on.
Here's a picture of the wrong cat, Nicodemus, sleeping in the hammock to spite his sister.
And this is Skitty, who wouldn't climb in until I put her there, and wouldn't leave once I did. You're welcome.
Sunday, April 13, 2014
Project: Set Design for Beauty and the Beast
I had a pretty impressive delay on starting this blog, and you can blame a fair mixture of social anxiety and high school theatre tech for that. My school doesn't have a whole lot of project based classes in it, but I go crazy if I spend all day doing reading assignments, so BAM, theatre crew.
This turned out to be a great choice for my mental health, but not so much for my free time.
I worked two shows (for a later post!) as well as taking the class. The director had decided that for our final show, we were gonna go with Beauty and the Beast. The Disney version. The Full version.
I was picked as one of eleven crew heads out of twenty-something crew, at which point I realized what I had gotten myself into.
Here's a rundown of what's taken over my last three months.
1. The Beast's Chair
This turned out to be a great choice for my mental health, but not so much for my free time.
I worked two shows (for a later post!) as well as taking the class. The director had decided that for our final show, we were gonna go with Beauty and the Beast. The Disney version. The Full version.
I was picked as one of eleven crew heads out of twenty-something crew, at which point I realized what I had gotten myself into.
Here's a rundown of what's taken over my last three months.
1. The Beast's Chair
For some reason I don't have a picture of it upholstered, but this was my first project for the musical. Me and two of my classmates were given some pictures of armchairs from other productions, and told to design and make our own. The chair itself is about 3ft. wide and 6.5ft tall, pretty fricking heavy, mostly because of the back. It's name is Dylan. See our selfie below.
The theatre director claimed it as her 'throne' in the scene shop.
2. The Spiral Staircase
My next big project started when the tech director learned that I was in a higher level math class. I walked into the classroom and was immediately told "we need to build a spiral staircase, but it needs to start out being 6 feet wide and taper to 4 feet wide, go from *here* to *here* and curve like *this*." I didn't actually help much with the building of this, but the design was all mine.
3. The Rooftops
By the end, I designed and built three roofs for the show, two for Belle's house, and one for another building that served a number of purposes. They looked very asymmetrical and cartoony, which was great for the audience, but meant we had to have three people to build each one, and even then they sometimes had to be rebuilt. Not to mention, they were heavy enough that we had to tie them to a batten and fly them to get them on the houses.
4. Foam proscenium… thing?
I don't know why we had to have this particular flourish, and it was definitely my least favorite project of the show, just because it was so picky as far as measurements go so that it could be symmetrical. I designed and cut the pieces for the two layer frame for the proscenium arch. (At one point I had to recut something because it wasn't 'wavy' enough) The effect is cool, but that was a week of high blood pressure I could have lived without.
5. Maurice's Invention
I enjoy working with projects that have moving parts and electric components, so this was my main project throughout the production. It's named Ada, after Ada Lovelace, the first computer programmer. What I'm most proud of in this project is that nothing had to be purchased for it. Everything on the invention came from the scene shop or from set pieces from previous shows. Even the wheel attached to the axe came from our second bicycle (which was apparently in three pieces.)
I designed the invention, presented my design to the tech director, and then I worked with an assistant to build the thing. The box on the back held the 'log' to be chopped, and the top was attached by a hinge so Maurice could get to it. The actually chopping motion was supposed to be controlled by a plain DC motor, but the tech director couldn't get one. I ended up ghetto rigging a drill during hell week to turn the belt of the bike wheel and spin a pole attached to the bike wheel and the axe head, while the axe handle was bolted to the invention, which created a second-class lever and a pretty forceful chopping motion. This worked at every rehearsal, until opening night, of course. The Tech Director and I reworked it, and it worked perfectly every other night.
The whole thing is long and heavy, and somehow (barely) rideable. It chops cardboard logs with gusto. It makes me prouder every day. Yay Ada!
5. The Castle
The castle was designed by the directors, but all crew helped build it, and it's really awesome to see it painted and everything, in it's entirety. It's all on casters (we had to push it forward during 'be our guest' as a special effect), and the west wing, stage left, is hollow underneath with an access door on the back. This was so that four of the crew could push it forward and spin it right before the beast's first solo song and show the balcony. It was an awesome show to work on, and apparently to see, as by the second night it was SRO. The actors did amazingly well, and I had so much fun working on it. Now just to wait for next year!
Subscribe to:
Posts (Atom)