More results...

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
post
page
Python IDE Dashboard

OCR J277/01 – 1.1 System Architecture

1.1 System Architecture - Overview / Checklist
1.1.1 Architecture of the CPU
The purpose of the CPU:

    The Fetch – Decode – Execute Cycle

Common CPU components and their function:

    ALU (Arithmetic Logic Unit)
    CU (Control Unit)
    Cache
    Registers

Von Neumann architecture:

    MAR (Memory Address Register)
    MDR (Memory Data Register)
    Program Counter
    Accumulator
1.1.2 CPU performance
How common characteristics of CPUs affect their performance:

    Clock speed
    Cache size
    Number of cores
1.1.3 Embedded systems
The purpose and characteristics of embedded systems
Examples of embedded systems

Recommended Resources

Further Reading…

Embedded Systems in a Smart World

In our modern world, we are surrounded by technology and more and more every day objects now include some built-in computer system. Such objects are called embedded systems and we can define an embedded system as follows:

An embedded system is a computer system built-in a larger device in order to control it.

As opposed to generic purpose computers such as desktop computers and laptops, embedded systems tend to be more specialised and have a reduced set of functionalities specific to the device they are controlling. This also means that the computer hardware used in an embedded device is more basic and cheaper to produce than the hardware you would find within a computer desktop or laptop. It’s also often smaller and can hence be embedded within tiny devices such as wireless earpods.

The digital/smart revolution

Have you noticed how over the last few decades, a lot of our every day objects have been upgraded to become digital or smart? A digital or smart object such as a digital camera, a smart watch or a smart speaker is an embedded device: it can process digital (binary) data and is operated via a built-in computer system inside it and that has been programmed to control the device.

Check the following slide show for some examples of every day objects which have become digital / smart embedded systems:

As any computer system, embedded systems consist of both hardware and software: They have to include computer programs that are used to operate them. They manipulate binary data using the Input > Process > Output model.
So most embedded devices will include at least one input device (microphone, keypad, photo lens, sensors) a processing unit and at least one output device (speaker, screen, LEDs, actuators to control motors, etc.).

A connected world and the Internet of things

An embedded system can be a standalone system, but recently you will find that a lot more embedded systems are also connected to other devices and /or to the Internet.

For an embedded device to connect to another device it may rely on a wired or a wireless connection such as a USB cable (wired connection) or Bluetooth (wireless connection). For instance wireless earphones, smart speakers, activity trackers all use Bluetooth to connect to your smartphone or computer.

More and more of these devices are also directly connected to the Internet (via WiFi or 3G/4G/5G). Smart watches, smart speakers, smart TVs can all connect to the Internet to retrieve and log information on a central server. We call this proliferation of smaller connected objects/embedded devices the “Internet of Things”. The Internet of things is no longer a network of generic purpose computers like it used to be in the mid 90s. Nowadays it connects a wide range of computers and embedded devices which all have their unique IP address and transfer data across the Internet using the TCP/IP protocols.

This huge increase in the number of connected devices means that the current format used to allocate a unique IP address to a device (IPv4) is no longer adapted: There are not enough unique unique IPv4 addresses for all the connected devices worldwide, hence the need to upgrade to a new format, IPv6, which contains far more unique IP addresses. In fact, with IPv6, we probably have more unique IP addresses than we will ever need.

Embedded devices in today’s world

So, as mentioned at the start of this blog post, we are nowadays surrounded by technology / embedded devices. So let’s investigate where can we find most of these devices:

Home Automation
Our homes include more and more embedded devices. Our entertainment systems are all becoming smart connected devices: Tablets, Smart Phones, Smart speakers, Smart TV’s are all examples of embedded devices.

More and more embedded devices are also used to monitor and control different aspects of our home. This is called home automation and includes the use of:

  • smart readers to control your energy use,
  • smart central heating systems,
  • smart lighting systems,
  • smart burglar alarm systems,
  • video doorbell systems,
  • etc.

Wearable Technologies
Wearable technologies regroups all the technologies and embedded systems that we wear on us:

  • smart phones,
  • smart watches,
  • activity/fitness trackers,
  • GPS trackers (often included in a smart watch, activity tracker or smart phone),
  • Medical Monitoring Devices such as Heart Rate monitoring devices,
  • MP3 Player,
  • Noise cancelling earphones,
  • etc.

Automotive Technologies
Automotive technologies regroup all the technologies and embedded devices when we use a motorised mean of transport such as a car.
Modern cars includes a wide range of embedded devices including:

  • GPS SatNav Systems
  • Automated Braking Systems (e.g. Anti-lock Braking System: ABS)
  • Cruise Control
  • Climate Control / Air-Conditioning Control System
  • Automatic Parking System
  • Airbag Control Unit
  • Tyre Pressure Monitoring System
  • etc.

Embedded Systems on the High Street
Embedded systems are also used on the high street for security purposes, to collect statistical data, to regulate traffic, etc. A few examples include:

  • CCTV Security/Monitoring Systems
  • Speed Cameras
  • Automated Traffic Lights Systems
  • Car Park Monitoring Systems
  • Air Pollution Monitoring Systems
  • Noise Pollution Monitoring Systems
  • Connected weather stations
  • Etc.

Embedded devices: Drag and Drop

Embedded Devices – Drag and DropOpen in New Window

Computer Science – Cryptic Crossword #01

The first cryptic crosswords originated from the United Kingdom and appeared in the mid 1920’s. A cryptic crossword is a type of crossword puzzle in which each clue is a word puzzle including anagrams, acronyms, synonyms, homophones and other wordplays.

Cryptic crosswords where used during World War II at Bletchley Park, UK to help with the recruitment of logical and analytical minds with lateral thinking abilities. These were the required treats needed to become a proficient code breaker and help decode encrypted secret messages.

You can find more about Bletchley Park and the role of code breakers such as Alan Turing during World War II by completing our Enigma – Mission X challenge.

Before attempting to solve this challenge, you should familiarise yourself with the different types of clues that the crossword definitions can be based on. Effectively, the definitions given in a cryptic crossword, will almost never be a literal meaning of the answer you are looking for. Instead, they will be based on a wordplay. When looking at a definition, you will first need to try to locate the two main hints which are:

  1. An exact definition or synonym, in much the same way as a conventional crossword clue. This can appear either at the start or at the end of the definition.
  2. Some sort of wordplay. There are many different types of wordplay that can be used. Sometimes an indicator term (a specific expression or word) will lead you to the type of wordplay that is being used.

Let’s investigate some of the most common types of cryptic crossword definitions:

Double DefinitionAnagramsAcrosticHidden WordsReversalHomophonesCharadesDeletionCrypticComplex

Double Definition:

When the clue consists of two different meanings of the same answer.
Double Definition

Anagrams:

With these clues you will have to jumble up the letters from the clue to find the answer.
Anagrams

Acrostic:

These sorts of clues means that you will have to take some of the letters (e.g. the first letter of each word, or the last letter, or every odd letter, etc.)
Acrostic Definition

Hidden Words:

When the answer is actually included within the clue itself! you just need to spot it!
Hidden Words

Reversal:

When you need to read a word or expression backwards, from right to left.
Reversal

Homophones:

The answer you have will sound similar to the actual answer you are looking for! You may have to say it out loud to find it!
Homophones

Charades:

Charades will involve joining several parts of words together to get to the final answer.
Charades

Deletion:

On occasion you will need to remove one or several letters from the clue to get to the answer.
Deletion

Cryptic Definition:

These can be quite challenging, using a confusing definition sometimes purposefully given in a somewhat misleading way.
Cryptic Definition

Complex Definition:

When you start combining several techniques within the same definition!
Complex Definition

The following Cryptic Puzzle is based on Computer Science Terminology (from the A Level Computer Science Specification).
Computer Science Cryptic CrosswordOpen Cryptic Crossword Puzzle in a New Window
Computer Scence Cryptic CrosswordOpen Cryptic Crossword Puzzle in a New Window

unlock-access

Solution...

The solution for this challenge is available to full members!
Find out how to become a member:
➤ Members' Area

Big O Notation – Quiz

Before completing this quiz, we invite you to revisit the main Big O Notations used to describe the time complexity and space complexity of an algorithm..

The main Big O Notations this quiz will focus on are:

Take the Quiz! (open full screen)


Reserved Keywords of the Python Language

If you have reached this page, you have probably already started to learn to code using a high-level programming language such as Python, JavaScript, C, php or Ruby. But what does “learning a new programming language” involve?

Learning a programming language is, to some extent, like learning a foreign language. It will require you to learn the words this language is made of. The good news is, unlike modern languages such as English, Arabic, French or Mandarin, programming languages have a very limited number of words for you to learn: these are the reserved keywords and built-in functions of the language.

Let’s compare different programming and non-programming languages!


English?
🗩
According to the Oxford English Dictionary, the English language contains more than 170,000 words!


Python?
💻
Python v3.6 contains exactly 33 reserved keywords and 71 built-in functions.


Hindi?
🗩
It is estimated that the Hindi language contains between 150,000 and 185,000 words.


HTML?
💻
The HTML (version 5.2) language contains 142 different tags.


CSS?
💻
The CSS (version 3.0) language contains around 520 distinct properties.


French?
🗩
According to the Larousse dictionary, the French language has approximately 135,000 words.


Java?
💻
Java contains exactly 53 reserved keywords with an additional 4,000 built-in functions in the JDK.

It is believed that to be able to be able to take part in every day conversations in a foreign language, you need to know around 2,000 to 3,000 words. To be fluent in a language, you would need to know between 5,000 to 10,000 words!

Luckily, to become a proficient programmer using a programming language, you do not need to remember that many words!

As you have started to learn Python, you can test yourself to see how many of the reserved keywords and built-in functions you can remember by completing the quiz below!
Python QuizOpen in New Window

101 Binary Watch


A binary watch uses 18 LEDs to give the HH:MM:SS time using three binary numbers each consisting of 6 bits.

The following diagram can help you understand how to work out the time displayed on a binary watch:

Using the above diagram we can work out the actual time being displayed:

Your Task:


Can you tell what is the time displayed by each of the following binary watches:

HH:MM:SS: (view solution)
HH:MM:SS: (view solution)
HH:MM:SS: (view solution)

The FDE Cycle… In your own words

Before completing this task, you will need to revisit the main characteristics of the Von Neumann Processor Architecture.

You task is to write a description in your books or on the space provided below to describe, in your own words, how the FDE cycle works. Your description needs to include as many of the following key terms as possible.

Fetch Instruction Register
Decode Data Program Counter
Execute Memory location MAR
Primary Memory Control Unit MDR
RAM ALU Accumulator
Binary Clock speed GHz

The FDE Cycle… in your own words!

Describe, in your own words, how the FDE cycle works within the CPU. Use as many of the keywords provided above as possible.




Word Count: 0
unlock-access

Solution...

The solution for this challenge is available to full members!
Find out how to become a member:
➤ Members' Area

Anatomy of a computer program

Computer programs are a set of step-by-step instructions used to teach the computer how to complete a task.

Computer programs are written using a specific programming language. Nowadays, most programmers would write code using a high-level programming language such as Python, C, C#, Java, Ruby or Basic.

If we were to dissect a computer program, we would find the following elements:

  • Reserved Keywords & Built-in Functions
  • Identifiers (e.g. for variables and subroutines)
  • Values of different data types
  • Computing Operators
  • Punctuation signs
  • Comments/Annotations

Let’s investigate these elements further… Click on the sub sections below to find out more.

Reserved Keywords & Built-in Functions
The reserved keywords are defined by the language used to write your code. As opposed to a foreign language like French or Spanish, high level programming languages such as Python or Java only have a few dozen reserved keywords.

For instance, in Python 3.6 there are 33 reserved keywords and a few built-in functions such as print,input,str,int,float.

Here is a non-exhaustive selection of some of the most useful Python reserved keywords and built-in functions.

Reserved Keywords:

if elif else
while break continue
for in as
import from global
def return local
class del none
try except raise

Built-in Functions:

print input range
str int float
min max round
len chr ord
Identifiers (e.g. for variables and subroutines)
Identifiers are the name the programmers will choose when creating a variable, a constant, a function or a procedure. For instance, when storing the score of a game using the following line of code:

score = 0

score is the identifier of the variable that stores the score of the player.

Note that a programmer cannot used reserved keywords or built-in functions as identifiers in a program.

For instance in python you cannot have a variable called while as input is a reserved keyword of the language.

Note that, with Object-Oriented Programming languages, you will also use identifiers to give a name to your classes and objects.

Values of different data types
The values are the pieces of data used in a program. They can be hardcoded within the code or retrieved as input.

Each value as its own data type:

  • String values which contain a alphanumerical characters e.g. “James”, “Bond”, “007”
  • Integer values which contain whole numbers (positive or negative) such as 365 or -10
  • Float values (aka Real) which contain numbers which can have a decimal point such as: 3.14 or 9.81
  • Boolean values which are either True or False

Notice how, when using a string value in your code, you have to use “speechmarks”. This is because you do not want your computer to be confused between reserved keywords, identifiers and string values.

Computing Operators
There is a range of different operators that can be used in a computer program including:

  • The Assignment Operator =, used to assign a value to a variable or a constant e.g.
    score = 0
  • Arithmetic Operators +, , *, /, **, //, % used to perform arithmetic calculations
  • Comparison Operators <, >, <=,>=, ==, !=
  • Boolean Operators and, or, not
Punctuation signs
Each language has its own syntax and its own set of punctuation signs. In the English language the example of punctuation signs are the comma ,, the full stop., the question mark ?. And syntax in a language do matter as omitting or using the wrong punctuation sign it can alter the meaning of a message. For instance, would you go swimming in these waters, knowing that “crocodiles do not swim here”?

Programming languages have their own syntax too. Not using the correct syntax in your code will generate a syntax error. This means that your computer cannot interpret your code and hence will not run it.
In Python, the main punctuation signs are the brackets (, ), [, ], { and } the colon : and the comma ,.
Comments/Annotations
Finally, most programs will include some comments (aka annotations). These are optional and are only for the benefit of the programmers who will read and work on your code. Comments provide key explanations of what a section of code is doing. Comments will be completely ignored by the computer.

In Python, comments have to start with a # sign. e.g.

#This is a single-line comment

You can also create comments over multiple lines using a triple quote: “””. e.g.

""" 
    This is a multi-line comment.
    You can add much more information here.
    These are often used at the top of your code to specify:
         - the version number, 
         - the date the code was last updated
         - copyright information.
"""

Your Task

Your task is to identify all the different elements of the short program below, and drag them in the corresponding sections.
Anatomy of a Computer Program – Drag and DropOpen in New Window

The Von Neumann Processor Architecture

John Von Neumann (1903-1957) was a Hungarian-American mathematician, physicist and computer scientist and a founding figure in computer science, with significant contributions to computing hardware design.

The Von Neumann architecture refers to a processor architecture which has access to a program stored in primary memory as a set of instructions. A processor based on the Von Neumann architecture can execute these instructions sequentially using the Fetch Decode and Execute cycle (FDE Cycle).

Nowadays most general purpose computers are still relying on the key characteristics of this architecture. Within the Von Neumann architecture the processor consists of a control unit, an arithmetic logic unit (ALU) and some key registers used to store numerical values within the processor. These include a Program Counter (PC), an Accumulator, a Current Instruction Register (CIR), a Memory Data Register (MDR) and a Memory Address Register (MAR). These registers are used during the FDE cycle for the processor to fetch instructions and transfer data (between the processor and primary memory) and to execute these instructions.

The rate at which a processor can perform the FDE cycles to process instructions is called the clock speed. For instance, a processing unit with a 3.5GHz clock speed can process 3,500,000,000 instructions per second.

Recent computers have a high clock speed and more advanced processors may also have multiple cores (dual core, quad core etc.) which enable them to process several FDE cycles simultaneously. They may also contain cache within the CPU which can be used to store (and retrieve at a very fast rate) recently or frequently used instructions or data without the need to retrieve these from primary memory. A Central Processing Unit (CPU) with multiple cores, a certain amount of cache and a high clock speed will lead to an increase of the performance of the CPU.


Inside the CPU – Drag and DropOpen in New Window

Poem Decoding Challenge

To celebrate the start of the Winter, we have asked our Artificial Intelligence “AI-101” to generate a poem about the cold winter weather. The AI has generated the following poem which consists of a list of numbers! We believe the poem is in a compressed format. We found within the log of the AI a hash table (codebook) as appearing on the tablet below.

We believe this codebook is the key to uncompress the poem. (Click on the picture below to open full screen)

Challenge #1

Use the above codebook and printed poem to reveal the title and 8 verses of this poem.

Challenge #2

Implement a recursive algorithm to uncompress this poem using the given hash table by completing the code below.

unlock-access

Solution...

The solution for this challenge is available to full members!
Find out how to become a member:
➤ Members' Area
Tagged with: