unit 2 Flashcards
(46 cards)
coding or programming
This is how we tell computers what we want them to do
Bright Idea #1
In 1679, Gottfried Leibniz invented the binary number system that uses only two characters—0 and 1—instead of the decimal system that uses numbers 0 through 9.
Bright Idea #2
In 1605, Francis Bacon worked out that letters of the alphabet could be reduced to sequences of binary digits. This is how ‘hello’ is written using the binary number system: 01101000 01100101 01101100 01101100 01101111.
Bright Idea #3
George Boole devised a form of algebra that encoded logic in terms of two states—true or false, yes or no, one or zero. If expressed that way, practically any mathematical or logical problem could be solved by just three basic operations, dubbed ‘and,’ ‘or,’ and ‘not.’
Bright Idea #4
During the late 1930s, several researchers realized that Boole’s operations could be given physical form as arrangements of switches—a switch being a two-state device, on or off. George Stibitz of AT&T’s Bell Laboratories built such a device using strips of tin can, flashlight bulbs, and surplus relays. The ‘K-Model,’ as Stibitz called it (for kitchen table), could add two bits and display the result.
Bright Idea #5
In 1939, John Atanasoff, a physicist at Iowa State College, constructed a rudimentary binary machine, and around the same time Konrad Zuse built a programmable calculator in Germany. It used Boole’s Boolean logic together with Leibniz’s binary numbers to store numbers representing information, or data and performed very simple mathematical operations. Thus, the first computer was born.
data
Inside your computer, there are a couple of core components that store and process data. These components include a main memory to store program instruction and data that is currently being used so that it is quickly accessible. If the computer was a brain, the main memory would be the short-term memory. There is also the secondary memory, that stores information for the long run.
programming languages
programming languages create codes that represent binary numbers, so that programmers can write computer programs in a language closer to their natural speech. Another program can also easily translate their code into binary instructions that the computer can understand.
machine code
Machine code uses numbers to represent binary strings, making instructions much shorter and giving the programmer the ability to reference specific locations in the computer’s memory. And is a second generation language
Assembly language
Assembly language goes one step further and uses short letters or words to represent machine code instructions, and in turn binary code.
MOV AL, 61h
MOV AL, 61h represents the binary value 10110000 01100001. In simple English, it is telling the computer to “move a copy of the following value into position AL in the computer’s memory: 97.”, MOV AL is the instruction, and 61h is the number 97.
Translators
Special programs that translate computer programs into machine code are called translators. There are two main types of translator programs, compilers and interpreters.
Compilers
Compilers produce a fully translated program that can be saved in a file and executed whenever it is needed. Often these programs are compact and can run very quickly.
executable program
Compilers read an entire program in a programming language and produce the complete set of machine instructions for that program, known as the executable program, to be saved and run later.
Interpreters
Interpreters read small portions of a program at a time, translate them to machine instructions, and execute these instructions immediately.
operating system
There are many important system programs. One that is extremely important in most computers is the operating system, as it makes all the other software and hardware work well together.
3GL
3GLs allow us to write computer instructions with greater ease and simplicity.
low-level languages
Today, there are five generations of computer programming languages. First- and second-generation languages are called low-level languages
high-level languages
Third-, fourth-, and fifth-generation languages are called high-level languages as they let you write computer code using more natural speech.
programming paradigms
There are different ways to structure your instructions, and the instructions are suited to different purposes.
procedural programming
In other words, the computer program tells the machine what to do in order, step by step. This became the natural paradigm for early programming languages, and it is still a natural place for the beginner programmer to start.
object-oriented programming (OOP)
Giving a computer a description of what you want.
Principle 1: Objects & Methods
An object is a collection of data about an item, such as a ball, or the beach, or the ocean that we spoke about earlier. The data about an object is called its properties.
functions
In OOP, the sequence of statements, or the functions, “belong” to the object.