Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Why Computer Languages? Compute are stupid. –They do not “understand” things. –They have to be told very precisely what to do. Natural language are ambiguous.

Similar presentations


Presentation on theme: "1 Why Computer Languages? Compute are stupid. –They do not “understand” things. –They have to be told very precisely what to do. Natural language are ambiguous."— Presentation transcript:

1 1 Why Computer Languages? Compute are stupid. –They do not “understand” things. –They have to be told very precisely what to do. Natural language are ambiguous. –“College Station’s largest (quality (free) newspaper)”.

2 2 Programming language are designed to be unambiguous. –They are defined precisely, by syntax and semantics. –The meaning of each program is defined precisely. Associativity is defined, e.g., 2-3-4 means (2-3)-4. Priority of Operators is defined, e.g., 2+3*4 means 2+(3*4).

3 3 High-Level Pascal Pgm Program Example: const x = 12; y = 30; var z: integer; begin z := x + y; end.

4 4 Assembly Program EXAMPLE CSECT Balr 12, 0 Using Base 12 Base L 2, X A 2, Y ST 2, Z BCR 15, 14 X DC F ’12’ Y DC F ’30’ Z DS F END CSECT

5 5 Machine Code( Hexidecimal) 05C0 Balr 12, 0 5820 C00E L 2, X 5A20 C012 A 2, Y 5020 C016 etc. ST 2, Z 07FE BCR 15, 14 0000000C X DC F ’12’ 0000001E Y DC F ’30’ 00000000 Z DS F END EXAMPLE


Download ppt "1 Why Computer Languages? Compute are stupid. –They do not “understand” things. –They have to be told very precisely what to do. Natural language are ambiguous."

Similar presentations


Ads by Google