Programming FAQ

Frequently Asked Questions

This page provides some general information on computer programming.
Click on one of the questions below to go to the answer.
Click on the Back button on the tool bar to return to the list of questions.

  1. What is Programming?
  2. What are bits and bytes?
  3. What is hexadecimal?
  4. What is Binary Code?
  5. What is Assembly Language?
  6. What are High Level Languages?




What is Programming?
Writing a list of instructions that tells the computer, in very precise terms, how to do what you want it to do. The problem is in writing the instructions in such a way that the computer can understand them.

What are bits and bytes?
Computer memory is made up of individual units called bytes. A byte is capable of storing numbers from 0 to 255. It takes one byte of memory to store a single letter of a text document. The characters that can be stored are known as the ASCII character set (ASCII stands for American Standard Code for Information Interchange). Each byte is made up of eight bits and a bit is like a single on-off switch. The pattern of on/off bits in a byte determines the value stored in that byte. To store numbers computers used the binary or base-2 numbering system. The table below shows the


Bits and Bytes


What is hexadecimal?
Hexadecimal is a base-16 numbering system. Because it is very easy to translate from binary to hexadecimal many programmers, expecially those who work with assembly language prefer to use base-16 numbers. The table below shows the numbers 0-16 in binary, hexadecimal and decimal.

Binary Hexadecimal Decimal
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111
10000
0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F
10
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16


What is Binary Code?
Binary code is really the only language the computer can understand. It consists of just a stream of ones and zeros. When you write a program the compiler translates your program into binary code that the computer understands and can run.


Binary Code: Just 1s and 0s


What is Assembly Language?
Assembly language is a step up from binary code, but it still requires you to understand about the inner workings of the microprocessor (the heart of the computer). Below is a simple example of assembly language written for the 6502 microprocessor used in the original Apple II and other computers. Once written the assembly language program had to be translated into binary code for the computer by a special program called an Assembler.

           LDX 02      ;Load X register with hex 2
           LDA 02      ;Load Accumulator with hex 2
           ADC X       ;Add 2 and 2
           STA 3e8     ;Store the results in memory address 1000


Layout of the 6502 Microprocessor


What are High Level Languages?
High level languages let you write a program in something closer to English. This includes programming language like BASIC, Fortran, Cobol, Snobol, Algol, PL1, Smalltalk, Modula-2, Forth, Lisp, Prolog, Pascal, Logo, C/C++, Perl, Ada, Python, Ruby, and of course Java. High level language must be translated into binary code by a special program called a Compiler.

     5 REM THIS IS A PROGRAM IN BASIC
     10 X = 2
     20 Y = 2
     30 SUM = X + Y
     40 PRINT SUM
     50 END
     /** This is a Java program */
     public class HelloWorld 
     {
          // main(). The starting point of all programs
          public static void main(String[] args)
          {
               int x;
               int y;
               int sum;
               sum = x + y;
               System.out.println("2 + 2 = " + sum);
          }
     }



This site is still under construction