Sunday, 5 March 2017

RFID

this stands for Radio Frequency Identification Key

this can be used for unlocking car doors

the tag is the transponder and the reader transmits the signal
the signal activates the RFID transmitter (tag)

how it works:

antenna sends radio wave signal and the transponder receives the radio waves and induces an electrical current and sends the response to the reader via radio waves

no physical connection is needed

the tag must be near the reader

Sunday, 12 February 2017

files in programming

to create a new file:

dim aLine as string

fileopen(1, "Diary2.txt", openmode.output)
console.writeline
aLine = console.readline
Printline(1,aLine)
fileclose(1)


to read a file:

dim NextLine as string

fileopen(1, "diary.txt" , openmode input)
console.writeline
do wile not EOF(1)
next line  lineinput(1)
console.writeline(NextLine)
loop
fileclose(1)

to append a file (add onto a file)

dim aLine as string

fileopen(1, "Diary2.txt", openmode.append)
console.writeline
aLine = console.readline
Printline(1,aLine)
fileclose(1)

different translators

assembler


  • translates assembly language program into machine code


compiler


  • takes source code of a high level language and translates into object code
  • looks at the entire source code to translate and optimize the instructions 
  • the compiler will produce object code that can be distributed to people who do not need the development environment to execute the code.

interpreter

  • an interpreter analyses and executes source code line by line 
  • as each statement is analysed, the interpreter calls routines to carry out each instruction

software

software can be split into two different software's
application software
system software

system software covers 4 things

operating system:
manages the computer hardware
manages secondary storage
manages I/O devices
designed to act as an interface between user and computer.
manages the operation of the computer
links hardware application and uses virtual machine


library programs (DLL):
dynamic link library
carry out common tasks
critical for applications
will contain code, data resources
control dialogue boxes
mange memory display text and graphics

translator software:
compiler
assembler
interpreter
used by programmers to convert by one program to another
the CPU doesn't understand the programmers code, has to be translated into machine code of 1's and 0's

utility software:
to ensure the computer is running efficiently often supplied with the operating system
disk formatting tool

RAM- random access memory- volatile
ROM- read only memory- non-volatile

an operating system manages:
hardware to allocate processes
main memory
I/O devices
secondary storage

Virtual machines: the purpose is that the complexities of how tasks are done are hidden away from the user

Thursday, 19 January 2017

January Mock corrections

1a) a system stores integers in 16 buts. using binary representation, show the steps of subtracting 6 from 18, using two's compliment.

18= 0000000000010010
6=   0000000000000110
-6=  11111111111111001
                                      1
        1111111111111010
        0000000000010010
 12= 000000000000110

1b) A801= 1010100000000010

1.01010000000   0010

decimal value = -2.75


2a) smallest positive value

0.1000000  0001


3c) calculate the number of bytes

10 x 10 = 100
100 x 2 = 200
200 / 9 = 25 bytes

5b) if an image required 3000 colours - how many bits would be required for the colour depth?
12 bits

Sunday, 15 January 2017

logic gates

there are 6 different logic gates:

AND gate

Image result for and gate
A
B
A.B
0
0
0
0
1
0
1
0
0
1
1
1
The AND gate is an electronic circuit that gives a high output (1) only if all its inputs are high





OR gate
Image result for or gate
A
B
A+B
0
0
0
0
1
1
1
0
1
1
1
1
The OR gate is an electronic circuit that gives a high output (1) if one or more of its inputs are high.






NOT gate
Image result for not gate
A
1
0
0
1
The NOT gate is and electronic circuit that produces an inverted version of the input at its output. It is also know as an inverter. If the input variable is A, the inverted output is NOT A.

NAND
Image result for nand gate bbc bitesize
A
B
0
0
1
0
1
1
1
0
1
1
1
0
This is a NOT-AND gate which is equal to an AND gate followed by a not gate. The outputs of all NAND gates are high if any of the inputs are low




NOR gate
Image result for nor gate
A
B
0
0
1
0
1
1
1
0
1
1
1
0
This is a NOT-OR gate which is equal to an OR gate followed by a NOT gate. The outputs of all NOR gates are low if any of the inputs are high.





EXOR gate
Image result for xor gate
A
B
A+B
0
0
0
0
1
1
1
0
1
1
1
0
the “Exclusive-OR” gate is a circuit which will give a high output if either, but not both, of its two inputs are high.







Tuesday, 10 January 2017

Bubble sort algorithm

Bubble sort is a simple algorithm that compares based in which each pair of adjacent elements is compared. the values are then swapped when they are not in order. However this is not suitable for large sets of data as it is not a quick method for sorting.

Algorithm  
for all elements of the list
if list(i) > list(i + 1)
swap(list(i) = list(i + 1))
end if
end for
return list
end bubble sort

Pseudo-code 
repeat
swapped = false
for i = 1 to array - 1 do
if A(i) > A(i + 1) then
temp = A(i)
swap A(i) = A(i + 1)
A(i + 1) = temp
swapped = true
end if

Code
Module Module1
    'Callum Westcott
    'These are my variables
    Dim swap As Boolean
    Dim num(8) As Integer
    Dim temp As Integer
    Sub Main()
        'these are the values for the array
        num(1) = 20
        num(2) = 72
        num(3) = 69
        num(4) = 88
        num(5) = 42
        num(6) = 169
        num(7) = 101
        num(8) = 99

        'this do loop will make sure that all of the number will show in order
        Do
            swap = False
            For index = 1 To 8 - 1
                If num(index) > num(index + 1) Then
                    temp = num(index)
                    num(index) = num(index + 1)
                    num(index + 1) = temp
                    swap = True
                End If
            Next
        Loop Until swap = False

        'this will display the ordered array
        For index = 1 To 8
            Console.WriteLine(num(index))
        Next
        Console.ReadLine()
    End Sub

End Module