Username:
Password:
Programming With Ruby Tutorials

Meet Ruby / Computer Language

Subtitles of the Movie

In this video we're going to take a look at what is a computer language. So, very briefly, a computer language is essentially how you communicate with a computer; how you instruct the computer to accomplish some task or some set of tasks. We use, in order to do that, as programmers, we use a, a certain language, and there's plenty of different languages to choose from out there. I've just listed just a few there. We've got C, C++, Csharp, Java, Ruby, Ada Basic, and dot dot dot the list is huge, and if you search around on Google you can find charts that show lineages of families of these languages and how they're inter-related, and where they've come from, and the various strengths, and those types of things. So each language has, has a particular strength, but in the end they're all a way to communicate with the computer how a programmer wants something to occur. Now, what eventually happens, and we'll look at the process of how this happens a little bit more, here, but eventually those English-like instructions get converted to a set of, ah, electrical signals at the very lowest level inside the microprocessor of the computer. And there's a number of steps that you go through to get to that point. So here's some just basic Ruby, we saw this in an earlier video, it's just a simple little program that has someone, it prints out please enter your name, this first line here, just gets the name, prints it to the screen; the second one gets the input that the person types in, then the next line puts, so it prints out again, "hello" and adds the person's name, so it will say "Hello, George," or whatever is typed in up here, and finally the next line says, this one prints out your name as, it should be has, and the number of letters in your name. So that's a very simple little program. The steps are clear. We print out something, get some input, print something out, print something out with something calculated that we looked up. Pretty straightforward, pretty easy, pretty linear in the sense that you're going from one instruction to the next. So, the computer takes this through either the mechanism of a compiler or an interpreter, and we'll talk in other videos what the distinction between those are, and you end up with machine code. Now, over on the side here is the human readable form of this. These are op codes, assembly language op codes, but what the computer sees is right here: a series of ones and zeros. These correspond to instructions, but this is what the computer sees, and these are particular address spaces where this information is stored, and as the computer executes it, there's a little pointer, program counter it's called, that moves along and points at these various instruction sets and loads these into the microprocessor, and then it does what it needs to do. Now the mystery, probably even beyond that, is, well, how does it know what to do? And if you notice these are all ones and zeros, that's binary code, so it's representing numbers using zero and one, so it's a base-two number system, and how you actually get to a circuit, how you want to do something is through something called Truth Tables, and I wouldn't get too lost on something like this, but essentially you build up logic on how you want ah, to accomplish something through a very specific design process that involves these types of Truth Tables; there's another thing called Finite State Machines and several other tools that you utilize to get to, eventually you're goal is to get to this circuit. This circuit relates, not this one particularly, but this circuit relates directly back to, if we back up here, to this code. So when ones and zeros come in here these ones and zeros, say up here, are tied to specific, either specific pins, or there's a sequence of those instructions are fed in here, and this circuit responds with some particular output. Now this particular circuit is part of what's called a comparator, which means that you enter in two numbers down here and, specifically these are binary, so they're either going to be one and one or one and zero or zero and one, and what you'll get out over here is if one of them is less, so specifically here if, if the, uh this one here is less, you will get a high voltage here. Now this is part of an overall circuit, so there's other circuits similar to this that connect up on this side, and this goes on to another particular circuit over here, and there's actually more parallel ones connected together, so you can do a whole 32-bit number. So you feed that whole number in way over on this over on this end somewhere else, and some of those bits come flying through here and you get this output and it continues on. So your instruction started way up in an English kind of sentence with that print, or whatever, and eventually it goes through ah, the circuit level, it's making stuff happen using very simple components such as this not, this is an and, and an or, and other simple little things like that using these types of, of logic tables here to develop those circuits. Now that's a whole degree in Computer Engineering, and, and I'm not expecting you to get a lot of this other than understand that, that your instructions here eventually end up being voltage levels on a circuit like this, deep inside of your microprocessor. And also understand that a typical microprocessor has many, many millions of these things, these components. These components are gates, and a typical microprocessor has millions of these inside of it, so you can see what level of complexity is going on there. So, to recap, just quickly, a computer language is what allows you to enter English-like statements to have your computer accomplish some task.

Tutorial Information

Course: Programming With Ruby
Author: Al Anderson
SKU: 33788
ISBN: 1-934743-01-1
Release Date: 2007-08-21
Duration: 8.5 hrs / 113 lessons
Work Files: Yes
Captions: For Online University members only
Compatibility: Vista/XP/2000, OS X, Linux
QuickTime 7, Flash 8

VTC Sign up & Benefits

  • Unlimited Access
  • 81,350 Video Tutorials (20,800 free)
  • Video Available as Flash or QuickTime
  • Over 782 Courses
  • $30 for One Month Access
  • Multi-User Discounts Available