Bits and Bytes

Download Report

Transcript Bits and Bytes

A brief overview of software evolution
 Programming Languages
 First Generation Languages (Machine Language)
 We Actually have to do a few things.
First we have to find the operating code, or op code (by
number) to move the data (let’s assume the command
is number 28)
Of course, we have know the identifying number for
each of the registers (assume R1 = 12; R2 = 13)
Finally, we have to find the op code for addition
(Assume it is 37).
The code I enter might be:
28 2 12;
28 3 13;
(Well, Kind of – It’s a little more
37 12 13 13;
involved)
 Programming Languages
 First Generation Languages (Machine Language)
 Let’s not forget that the computer is just a series
of light-switches (binary). Therefore we need to
convert our decimal values to binary:
2
3
12
13
28
37
= 000000000000010 (on 16-bits)
= 000000000000011 (on 16-bits)
= 00001100 (on 8-bits)
= 00001101 (on 8-bits)
= 00011100 (on 8-bits)
= 00100101 (on 8-bits)
Therefore, We
would enter the
commands:
00011100 000000000000010 00001100;
00011100 000000000000011 00001101;
00100101 00001100 00001101 00001101;
MITS Altair
 Programming Languages
 Second Generation Languages (Assembly – c1948)
 The advancement over machine level languages
was that it was mnemonic (assisting or intended
to assist the memory)
We did not need to know the specific register addresses
We did not need to know the op codes
For the previous example, the code we enter might be:
MOV 2 R1;
MOV 3 R2;
ADD R1 R2 R2;
 An Assembler would then transfer the commands
into a machine level language
 Programming Languages
 Third Generation Languages (mid - late 1950’s)
 The advancement over assembly level languages
was that programmers did not need to know either
the op codes nor the registers used
• Specific locations in RAM were referred to by a user
defined name
• The compiler or interpreter, as well as the operating
system, kept track of the specific locations
• For the previous example, the code we enter might be:
X = 2 + 3 (FORTRAN)
 The code would then be rewritten as either an
assembly language code or directly to a machine
level language
 Programming Languages
 Third Generation Languages (mid – late1950’s)
 In the above example ‘X’ is a specific location in
RAM, although we don’t have to know where it is
• It is usually referred to as a variable
• Meaning that we can change the contents of the
location as we wish
• Although it can be a constant
• Meaning that once we set its value, it can not be
changed
 Either way, the address is assigned by the operating
system at run time and managed by the compiled
program (i.e., the machine-level program)
 Programming Languages
 Comparison of COBOL and FORTRAN (Hello World)
 COBOL (COmmon Business-Oriented Language)
• Intended to process large amounts of data as a batch
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
001 IDENTIFICATION DIVISION.
002 PROGRAM-ID. 'HELLO'.
003 ENVIRONMENT DIVISION.
004 CONFIGURATION SECTION.
005 SOURCE-COMPUTER. IBM-360.
006 OBJECT-COMPUTER. IBM-360.
0065 SPECIAL-NAMES.
0066 CONSOLE IS CNSL.
007 DATA DIVISION.
008 WORKING-STORAGE SECTION.
009 77 HELLO-CONST PIC X(12) VALUE 'HELLO, WORLD'.
075 PROCEDURE DIVISION.
090 000-DISPLAY.
100
DISPLAY HELLO-CONST UPON CNSL.
110
STOP RUN.
• Edsger Dijkstra, winner of the Turing Award remarked that
"The use of COBOL cripples the mind; its teaching should,
therefore, be regarded as a criminal offense."
 Programming Languages
 Comparison of COBOL and FORTRAN (Hello World)
 FORTRAN (FORmula TRANslation)
• Intended as a ‘Scientific Language’
PROGRAM MAIN
PRINT *, 'HELLO WORLD'
STOP
END
• It is one of the most popular languages in the area of highperformance computing and is the language used for
programs that benchmark and rank the world's fastest
supercomputers.
An Overview of the C/C++
Programming Languages
Overview of the C Programming Language
• Developed in 1978 at Bell Labs by
Kernighan & Ritchie after A & B failed
•
Associated with UNIX
• Developed on UNIX Systems
• UNIX and its software are written in c
• Intended as general purpose Language
• Basically a primitive language: 34 (28 original) Key words:
auto
break
case
char
const
continue
default
do
double
else
enum
extern
float
for
goto
if
int
long
new
register
release
return
short
signed
sizeof
static
struct
switch
typedef
while
union
unsigned
void
volatile
Overview of the C++ Programming Language
• Developed by Bjarne Sroustrup at Bell Labs
during 1983-1985.
• C++ is an extension of C.
• Prior to 1983, Stroustrup added features to C
and formed what he called "C with Classes".
• In 1983 the use of classes and object-oriented features with the
power and efficiency of C. The term C++ was first used in 1983.
• Additional C++ Reserved Words
and
and_eq
asm
bitand
bitor
catch
class
const_cast
continue
default
delete
dynamic_cast
explicit
export
false
friend
inline
mutable
namespace
not
not_eq
operator
or
or_eq
private
protected
public
reinterpret_cast virtual
template
wchar_t
xor
this
xor_eq
throw
true
try
40 Additional;
typeid
74 Total
typename
using
Overview of the C++ Programming Language
Computer languages rooted in C:
“Many later languages have borrowed directly or indirectly from C,
including D, Go, Rust, Java, JavaScript, Limbo, LPC, C#, ObjectiveC, Perl, PHP, Python, Verilog (hardware description language),[4]and Unix's C
shell. These languages have drawn many of theircontrol structures and other
basic features from C. Most of them (with Python being the most dramatic
exception) are also verysyntactically similar to C in general, and they tend to
combine the recognizable expression and statement syntax of C with underlying
type systems, data models, and semantics that can be radically
different. C++ and Objective-C started as compilers that generated C code; C++
is currently nearly a superset of C,[10] while Objective-C is a strict superset of
C.[11]”
http://en.wikipedia.org/wiki/C_(programming_language)