Computer science

?
  • Created by: Dream143
  • Created on: 26-01-18 11:49

Data types

Integer (whole number) = 4, 27, 65535 1 to 8 bytes

Floating point (decimal number) = 4.2, 27.4, 5.63 {4 to 8 bytes} 

Character a, F, 3, $, £, # {1 byte String abc, hello world Limited to the amount that can be stored in main memory}

Boolean true or false 1 bit

1 of 7

Logical operators

Boolean equivalent Equals =

Greater than >

Less than <

Greater than or equal to >=

Less than or equal to <=

Does not equal <>

And AND

Or OR

Not NOT

2 of 7

Data types

char(size) Fixed-length character string.

Size is specified in brackets.

varchar(size) Variable-length character string. Maximum size is specified in brackets.

integer(size) Number value with a maximum number of column digits specified in brackets.

date Date value float(size,d) Number value with a maximum number of digits of 'size' total, with a maximum number of 'd' digits to the right of the decimal.

Boolean True/False values.

3 of 7

Types of programming languages

Machine code instructions are simply numbers stored as a binary pattern of bitsi.e. 1010100101000000.

High-level code uses words that are designed to be read by human programmers as well as a computer

An assembler translates assembly language instructions into machine code instructions.

An integrated development environment (IDE) is a software application that provides a complete set of facilities for a computer programmer to develop a software application in a high level language, test it and then convert it into a stand-alone machine code application.

4 of 7

IDE

The IDE also includes several tools to automate and speed up processes.

  • Translator. This compiles or interprets the code.
  • Auto documentation. This explains the function and purpose of the code, eg by noting the modules and variables used, and its expected behaviour, and collates this into a text file that can be used by other developers to understand how and why the code was created.
  • Libraries. These provide functions that are not included in the core part of the programming language. These functions can be imported and used at the start of the program code. For example, in Python the Turtle Graphics library provides access to some simple drawing and graphics tools.
  • Build automation. These tools save time by automatically doing the processes that would otherwise be done by hand. These could include testing or compiling. These tools are extremely useful when a program has many thousands of lines of code. They improve the quality of the software, minimising bad software builds as well as saving time and money.
  • Debugger. This is a program within the IDE that is used to detect errors. If the debugger detects errors, it may suggest what the type of error is and what line it is on.
5 of 7

Logical gates

logic gate performs a logical operation on one or more logic inputs and produces a single logic output. The logic used in computer systems is called Boolean logic because there are only 2 possible values, TRUE or FALSE (represented in binary as 1 or 0).

6 of 7

Logical circuits

The symbols for the 3 basic logic gates AND OR NOT The logical AND symbol The logical OR symbol The logical NOT symbol This logic gate has 2 inputs and 1 output.

The output is TRUE only if one input AND the other input is TRUE.

This logic gate can be written as a logic statement:

O = A AND B

This logic gate has 2 inputs and 1 output.

The output is TRUE if one input OR the other input isTRUE.

This logic gate can be written as a logic statement:

O = A OR B

This logic gate has 1 input and 1 output.

The output is TRUE if the input is FALSE and visa-versa.

This logic gate can be written as a logic statement:

O = NOT A

7 of 7

Comments

No comments have yet been made

Similar Computing resources:

See all Computing resources »See all Programming resources »