Monday, April 17, 2017

Pre-Release Material Session May/June 2017 with Solution

Pre Release Material  
Summer 2017 | O Levels | Computer Science 
  
In Preparation for the examination candidates should attempt the following practical tasks by writing and testing a program or programs. 
The Organizer of a senior citizens’ club has arranges outings for the members. For each of these outings a coach is hired, meals at a restaurant are reserved and tickets for the theater has booked. A program is required to work out the costs and provide a printed list showing everyone on the outing. 
Write and test a program for the club organizer. 
− Your program must include appropriate prompts for the entry of data. 
− Error message and other output need to be set out clearly.         
− All variables, constants and other identifiers must have meaningful names.

You will need to complete these three tasks. Each task must be fully tested. 
  Work out the total cost of the outing. 

TASK 1
The organizer finds out how many senior citizens are interested in the outing. The program for Task 1 works out the cost for the information. 
Number of people  
Hire of couch  
Cost of a meal  
Cost of theater ticket  
12 – 16 
150 
14.00 
21.00 
17 – 26 
190 
13.50 
20.00 
27 – 39 
225 
13.00 
19.00 
 
The minimum number of senior citizens needed for the outing to go ahead is 10; there cannot be more than 36 senior citizens on the outing. A minimum of two carers go on the outing. With an additional carer needed if more than 24 citizens go on the outing. Carers do not have to pay anything for the outing. Workout the total cost per person for the senior citizens.

Task 2  
  Record who is going on the outing and how much has been paid. 
Using your results from Task 1, record the names of the people on the outing and the amount they have paid; include the carers on the outing. If there are spare places on the coach then extra people can be added; they are charged the same price as the other citizens. Calculate the total amount of money collected. Print out the list of the people on the outing. 

Task 3  
  Identify the break-even point or profit that will be made on the outing. 
Show whether the outing has made a profit or has broken even using the estimated cost from the Task 1 and money collected from Task 2. 

  
Solution (Pseudo Code)
Task 1

INPUT “Enter numbers of senior citizens : ”, citizen

WHILE (citizen < 10 OR citizen > 36)
PRINT (“The minimum number is 10 and maximum number is 36.”)
INPUT (“Enter numbers of senior citizens :”), citizen
ENDWHILE

IF citizen > 24 THEN people = citizen + 3 
    ELSE People = citizen + 2
ENDIF

IF people >= 12 AND people <= 16 THEN CoachCost=150 total = 150 + (14.00 * people) + (21.00 * people) ENDIF
IF people >= 17 AND people <= 26 THEN CoachCost=190 total = 190 + (13.50 * people) + (20.00 * people) ENDIF
IF people >= 27 AND people <= 39 THEN CoachCost=225 total = 225 + (13.00 * people) + (19.00 * people) ENDIF
CostPerPerson = total/citizen
  
TASK 2
PRINT (“Extra people can be added; they will be charged the same as the senior citizens.”)

IF people >= 12 AND people <= 16 THEN seats = 16 – people ENDIF
IF people >= 17 AND people <= 26 THEN seats = 26 – people ENDIF
IF people >= 26 AND people <= 39 THEN seats = 39 – people ENDIF
ExtraAmount = CostPerPerson * seats
TotalAmount = total + ExtraAmount 
UpdatedPeople = people 

IF seats >= 1 THEN UpdatedPeople = people + seats
 PRINT (“seats available for ”, seats,” person(s), Enter Name and Amount for people will to go for outing”)
FOR d = c to UpdatedPeople
INTPUT (“Enter the name of person on the outing”) , name(d)
INTPUT (“Enter the amount paid by the person     ”) , amount(d)
                                 AmountPaid = AmountPaid + amount(d)
              NEXT
ENDIF

FOR c = 1 to UpdatedPeople
            PRINT (“The Citizens’ Name :”, name(c) ,” & the amount submitted :”, amount(c))
NEXT

Task 3
EstimatedCost = CoachCost+(UpdatedPeople*(MealCost+TicketCost))
Profit = AmountPaid – EstimatedCost
IF profit > 0 THEN PRINT (“ The Profit Gained : “, profit)
ELSE PRINT (“The Break Even Point Value : “,total)

Explanation

Task 3 is all about finding the profit by subtracting the expected cost calculated in task 1 with the total of amount paid in task 2. But we also have to carefully add the meal and ticket cost of extra people going on the outing in the expected cost, using formula : EstimatedCost = CoachCost + (people x (meal cost + ticket cost)) and then, Amount paid - Estimated Cost 

Monday, May 2, 2016

Examination Tips

Dua Before Exams

The Prophet (sallallaahu `alayhi wa sallam) told the following dua to be recited in stress, studies, exams and trials

“O Allaah, there is no ease except what You make easy. And if You wish, You make the difficult easy.” [recorded in Hisnul-Muslim]

Tips for Exams And Students

The Muslim student puts his trust in Allaah when facing the tests of this world, and he seeks His help whilst following the prescribed means, in accordance with the words of the Prophet (peace and blessings of Allaah be upon him):

    “The strong believer is better and is more beloved to Allaah than the weak believer, although both are good. Strive to attain that which will benefit you and seek the help of Allaah, and do not feel helpless.” (Saheeh Muslim, hadeeth no. 2664)

Among those means are the following:

    Turning to Allaah by making du’aa’ in any way that is prescribed in Islam, such as saying, “Rabbiy ishrah li sadri wa yassir li amri (O my Lord, expand my chest and make things easy for me).”

    Getting used to sleeping early and going to exams on time.

    Preparing all required or permitted equipment such as pens, rulers and setsquares, calculators and watches, because being well prepared helps one to answer questions.

    Reciting the du’aa’ for leaving the house: “Bismillaah, tawakkaltu ‘ala Allaah, wa laa hawla wa laa quwwata illa Billaah. Allaahumma inni a’oodhu bika an adilla aw udalla, aw azilla aw uzalla, aw azlima aw uzlama, aw ajhala aw yujhala ‘alayya (In the name of Allaah, I put my trust in Allaah, and there is no strength and no power except with Allaah. O Allaah, I seek refuge with You lest I should stray or be led astray, lest I slip (commit a sin unintentionally) or be tripped, lest I oppress or be oppressed, lest I behave foolishly or be treated foolishly).”Do not forget to seek your parents’ approval, for their du’aa’ for you will be answered.

    Mention the name of Allaah before you start, for mentioning the name of Allaah is prescribed when beginning any permissible action; this brings blessing, and seeking the help of Allaah is one of the means of strength.

    Fear Allaah with regard to your classmates, and do not be affected by their anxiety or fear just before the exam, for anxiety is a contagious disease. Instead, make them feel optimistic by saying good words as prescribed in Islam. The Prophet (peace and blessings of Allaah be upon him) was optimistic when he heard the name of Suhayl (which means “easy”) and he said: “Things have been made easy for you.” He used to like to hear the words ‘Yaa Raashid, when he went out for any purpose. So be optimistic that you and your brothers will pass this exam.

    Remembering Allaah (dhikr) dispels anxiety and tension. If something is too difficult for you, then pray to Allaah to make it easy for you. Whenever Shaykh al-Islam Ibn Taymiyah (may Allaah have mercy on him) found something too difficult to understand, he would say, “O You Who taught Ibraaheem, teach me; O You Who caused Sulaymaan to understand, cause me to understand.”

    Choose a good place to sit during the exam, if you can. Keep your back straight, and sit on the chair in a healthy manner.

    Look over the exam first. Studies advise spending 10% of the exam time in reading the questions carefully, noting the important words and dividing one’s time between the questions.

    Plan to answer the easy questions first, then the difficult ones. Whilst reading the questions, write notes and ideas which you can use in your answers later.

    Answer questions according to importance.

    Start by answering the easy questions which you know. Then move on to the questions which carry high marks, and leave till the end the questions to which you do not know the answers, or which you think will take a long time to produce an answer or which do not carry such high marks.

    Take your time to answer, for the Prophet (peace and blessings of Allaah be upon him) said: “Deliberation is from Allaah and haste is from the Shaytaan.” (A hasan hadeeth. Saheeh al-Jaami, 3011).

    Think carefully about the answer and choose the right answer when answering multiple-choice questions. Deal with them in the following manner. If you are sure that you have chosen the right answer, then beware of waswasah (insinuating whispers from the Shaytaan). If you are not sure, then start by eliminating the wrong or unlikely answers, then choose the correct answer based on what you think is most likely to be correct. If you guessed at a correct answer then do not change it unless you are sure that it is wrong – especially if you will lose marks for a wrong answer. Research indicates that the correct answer is usually that which the student thinks of first.

    In written exams, collect your thoughts before you start to answer.Write an outline for your answer with some words which will indicate the ideas which you want to discuss. Then number the ideas in the sequence in which you want to present them.

    Write the main points of your answer at the beginning of the line, because this is what the examiner is looking for, and he may not see what he is looking for if it is in the middle of the page and he is in a hurry.

    Devote 10% of the time for reviewing your answers. Take your time in reviewing, especially in mathematical problems and writing numbers. Resist the desire to hand in the exam papers quickly, and do not let the fact that some people are leaving early bother you. They may be among the people who have handed in their papers too early.

    If you discover after the exam that you answered some questions incorrectly, then take that as a lesson in the importance of being well prepared in the future, and not rushing to answer questions. Accept the will and decree of Allaah and do not fall prey to frustration and despair. Remember the hadeeth of the Prophet (peace and blessings of Allaah be upon him), “If anything befalls you, do not say, ‘If only I had done such and such.’ Rather say, ‘Qadar Allaah wa maa sha’a kaan (the decree of Allaah and what He wills happened),’ for saying ‘if only’ opens the door for the Shaytaan.” (Saheeh Muslim, and the first part of this hadeeth was mentioned above).

    Note that cheating is haraam whether it is in foreign language tests or any other tests. The Prophet (peace and blessings of Allaah be upon him) said, “Whoever cheats is not one of us.” It is wrongdoing and it is a haraam means of attaining a degree or certificate, etc., that you have no right to. The consensus is that cheating is a kind of cooperation in sin and transgression. So do without that which is haraam, and Allaah will suffice you from His bounty. Reject all offers of haraam things that come to you from others. Whoever gives up a thing for the sake of Allaah, Allaah will compensate him with something better. You have to denounce and resist evil, and tell the authorities about any such thing that you see during the exam, or before or after it. This is not the forbidden kind of slander rather it is denouncing evil which is obligatory.

Advise those who buy or sell questions or post them on the Internet etc., or who prepare cheat notes. Tell them to fear Allaah, and tell them of the ruling on what they are doing and on the money they earn from that. Tell them that the time they are spending in preparing these haraam things, if they spent it in studying, or answering previous exams, or helping one another to understand the subject before the exam, that would be better for them than doing these haraam things.

– Remember what you have prepared for the Hereafter, and the questions of the examination in the grave, and how to be saved on the Day of Resurrection. Whoever is saved from the Fire and admitted to Paradise will indeed have succeeded.

We ask Allaah to make us succeed in this world and cause us to be among those who are victorious and saved in the Hereafter, for He is the All-Hearing Who answers prayer.

Wednesday, May 20, 2015

Fetch decode execute cycle

The Fetch-Decode-Execute cycle of a computer is the process by which a computer: fetches a program instruction from its memory, determines what the instruction wants to do, and carries out those actions. This cycle is repeated continuously by the central processing unit (CPU), from bootup to when the computer is shut down. In modern computers this means completing the cycle billions of times a second! Without it nothing would be able to be calculated. Registers/circuits involved Edit

The circuits used in the CPU during the cycle are:

Program Counter (PC) - an incrementing counter that keeps track of the memory address of which instruction is to be executed next...

Memory Address Register (MAR) - the address in main memory that is currently being read or written

Memory Buffer Register (MBR) - a two-way register that holds data fetched from memory (and ready for the CPU to process) or data waiting to be stored in memory

Current Instruction register (CIR) - a temporary holding ground for the instruction that has just been fetched from memory

Control Unit (CU) - decodes the program instruction in the CIR, selecting machine resources such as a data source register and a particular arithmetic operation, and coordinates activation of those resources

Arithmetic logic unit (ALU) - performs mathematical and logical operations

Wednesday, April 29, 2015

Tackling the CIE Exam Papers

The following material is original to the authors and the University of Cambridge Local
Examinations Syndicate are not responsible for the advice given. Please note that the information
that follows is not necessarily true for all questions. There will always be exceptions to general
rules and so these are intended only as a loose guide.
 
General tips
In many cases, you can find clues about the answer within the question itself. The main ‘clues’ are:
• the number of marks given for the question
• the key instruction words e.g. Name, Describe, Compare, Evaluate ...
• instruction/question text written in bold typeface.

The number of marks
Th e number of marks awarded for a question is given in square brackets [ ] after each question or
sub part of a question. Typically (though not always), the number of marks gives an indication of
how many different points you need to make. For example:

Explain what is meant array?                                                                            [2]

There are potentially 5 or 6 different points you could make to answer this question successfully.
However, as it is only worth 2 marks, the examiner is most likely only looking for any 2 correct
comments. You could spend 20 minutes writing 6 accurate comments but you would still only
score 2 marks because this is the maximum allowance for the question.

You won’t lose marks for writing extra answers, but you could waste time writing points that won’t
score you any more marks. Also, the examiner might decide to only look at the first 2 points and
ignore the rest. So, make sure you always put the answers you are certain are correct first before
any additional answers.

Th e number of marks indicates the likely number of separate points you need to make and it is also
a good indicator of how much time you should spend on that particular question. For example, it
is more sensible to spend much longer writing the answer to a question worth 5 marks than one
worth 1 mark. BUT this is not always the case. For some questions the number of marks does not
indicate how many comments you need to make. So, you should always take the time to think
about the questions and your answer before committing pen to paper.

Key instruction words
Th e examination questions will oft en have a single word that tells you how much detail is required
for each answer. Typically, the following is true:

• State, Name, List means that all you have to do is give the name of what is being asked for.
• Describe, Explain means you should say how something works (this will depend on the actual question, it
   might not always be how but it infers more detail than simply listing a name).
• Compare means you should say how both things work and sometimes what are the differences between
   them.
• Evaluate means you should say how well or poorly the object/method/application etc. works, or how
   suitable something is for a given scenario.
• Justify means you should say why the object/method/application etc. has been chosen.

Think about what each of these words is asking for in the question. This can really help you write a
good answer.

Instruction text written in bold or capitals
Th is applies to general text within the instruction/question as well as the key instruction words
mentioned above. When certain text is given in bold or sometimes CAPITALS it is meant to draw
your attention to it and emphasise its meaning.

Often a question will ask you to give ‘two examples of ’ where the word ‘two’ is written in bold
typeface. Th is means that you have to supply at least two examples in order to get the marks even
if the answer is only worth 1 mark! In other words, it is a clue to the minimum number of different
points you need to make regardless of the number of marks. Similarly, if the question included the
instruction to ‘Evaluate’ it means that you have to do more than simply state the name of a term.
You have to also discuss its advantages and disadvantages, for example. In such cases, you are being
given a direct and clear instruction and you must follow it in order to get the marks.

Examination technique
An hour of revision the night before the examination is a good idea. It is not a good idea to cram
in as much revision as possible at the last minute by spending hours revising the night before; or to
stay up into the early hours of the next morning.

What you really need to do is:

• get a good night’s sleep and relax in order to be in a positive frame of mind
• make sure you have the correct equipment (remember to take spare pens)
• when you get to the examination room:
– arrange your equipment on the desk and relax
– before you write anything, quickly read through all the questions on the examination paper,
   the last question is not always the hardest
– start by answering a couple of the easier questions to boost your confidence, then tackle the
   more diffi cult questions
– an alternative would be to answer the questions in increasing level of difficulty so that you
   leave the more difficult questions until the end
– remember to keep an eye on the time, don’t spend too long on any one question, even if you
   know everything there is to know on that particular topic. Th e question paper will usually
   tell you how many marks there are for each question and so you can use this to work out
   how much time to spend on each question
– in cases where you have to write in the answer, make sure that you answer every question
   even if you are having to guess. You cannot score marks if you don’t give an answer, but an
   educated guess could end up scoring you marks.

   Make sure you take whatever approach works for you. We are all different and work in different ways.
   Above all, READ THE QUESTION THOROUGHLY.



Wednesday, April 22, 2015

TCP/IP and Mac Address

MAC address:

A media access control address (MAC address) is a unique identifier assigned to network interfaces for communications on the physical network segment. MAC addresses are used as a network address for most IEEE 802 network technologies, including Ethernet and WiFi. Logically, MAC addresses are used in the media access control protocol sublayer..

MAC addresses are most often assigned by the manufacturer of a network interface controller (NIC) and are stored in its hardware, such as the card's read-only memory or some other firmware mechanism. If assigned by the manufacturer, a MAC address usually encodes the manufacturer's registered identification number. It may also be known as an Ethernet hardware address (EHA), hardware address or physical address. This can be contrasted to a programmed address, where the host device issues commands to the NIC to use an arbitrary address.


What is TCP/IP?

TCP/IP stands for Transmission Control Protocol / Internet Protocol. It defines how electronic devices (like computers) should be connected over the Internet, and how data should be transmitted between them.
TCP - Transmission Control Protocol
TCP is responsible for breaking data down into small packets before they can be sent over a network, and for assembling the packets again when they arrive.
IP - Internet Protocol
IP takes care of the communication between computers. It is responsible for addressing, sending and receiving the data packets over the Internet.

TCP/IP Protocols For the Web

Web browsers and servers use TCP/IP protocols to connect to the Internet. Common TCP/IP protocols are:
HTTP - Hyper Text Transfer Protocol
HTTP takes care of the communication between a web server and a web browser. HTTP is used for sending requests from a web client (a browser) to a web server, returning web content (web pages) from the server back to the client.
HTTPS - Secure HTTP
HTTPS takes care of secure communication between a web server and a web browser. HTTPS typically handles credit card transactions and other sensitive data.
FTP - File Transfer Protocol
FTP takes care of transmission of files between computers.

What is SSL?

What is SSL?

SSL stands for Secure Sockets Layer and is one security protocol that is used on the Internet. This is the technology that will show a “lock icon” and/or a green address bar on the browser to let people know that they’re visiting a website that is secured with SSL / TLS. (Note: TLS refers to Transport Layer Security, which is a broad security protocol that SSL fits into.)


Simply, SSL is a way to encrypt data that is sent from a web browser (like Internet Explorer, Firefox, or Chrome) to the web server. While it was primarily used in the past to protect sensitive information like credit card numbers and other data, these days it’s becoming used on a wider basis.

Without encryption, any information sent from the web browser to the web server can fall prey to a man-in-the-middle attack – which refers to bad guys grabbing the data after it leaves the browser and before it reaches the server. By encrypting the data going from a browser to a server, it’s possible to make man-in-the-middle attacks more difficult to pull off successfully.

Understanding Public Key Cryptography

To understand how SSL protects sensitive data, you need to know a thing or two about public key cryptography. While this deals with a lot of very complex math, we’re going to skip over a lot of the technical details in this guide and give you just the basic information you need to know in order to understand how SSL works.
Basically, to use an SSL connection, a public key and a private key are used. The web browser uses the public key to encrypt the data and the server uses the private key to decode the information. Instead of encrypting and decrypting keys every time a connection is made – which would take a lot of processing power – a symmetric key is created after the initial communication between the browser and server.

Establishing an SSL Connection

Next, I'm going to give a very basic outline of the process of establishing an SSL connection.
  1. Browser requests a HTTPS webpage
  2. Web Server sends public key and certificate
  3. Browser examines the SSL Certificate
  4. Browser creates a symmetric key and sends it to server
  5. Web server decrypts symmetric key with its private key
  6. Web server sends browser the page with symmetric key
  7. Browser decrypts the data and displays page
What’s amazing is that all that happens very quickly – without most people even noticing it’s going on under the hood.

Monday, March 9, 2015

Parity Bit and Parity Errors



Parity Bit

7 bits of data
(count of 1 bits)
8 bits including parity
even
odd
0000000
0
00000000
00000001
1010001
3
10100011
10100010
1101001
4
11010010
11010011
1111111
7
11111111
11111110

A parity bit, or check bit is a bit added to the end of a string of binary code that indicates whether the number of bits in the string with the value one is even or odd. Parity bits are used as the simplest form of error detecting code. There are two variants of parity bits: even parity bit and odd parity bit.

In the case of even parity, the number of bits whose value is 1 in a given set are counted. If that total is odd, the parity bit value is set to 1, making the total count of 1's in the set an even number. If the count of ones in a given set of bits is already even, the parity bit's value remains 0.

In the case of odd parity, the situation is reversed. Instead, if the sum of bits with a value of 1 is odd, the parity bit's value is set to zero. And if the sum of bits with a value of 1 is even, the parity bit value is set to 1, making the total count of 1's in the set an odd number.

Even parity is a special case of a cyclic redundancy check (CRC), where the 1-bit CRC is generated by the polynomial x+1. If the parity bit is present but not used, it may be referred to as mark parity (when the parity bit is always 1) or space parity (the bit is always 0).

Parity
In mathematics, parity refers to the evenness or oddness of an integer, which for a binary number is determined only by the least significant bit. In telecommunications and computing, parity refers to the evenness or oddness of the number of bits with value one within a given set of bits, and is thus determined by the value of all the bits. It can be calculated via an XOR sum of the bits, yielding 0 for even parity and 1 for odd parity. This property of being dependent upon all the bits and changing value if any one bit changes allow for its use in error detection schemes.

Error detection
If an odd number of bits (including the parity bit) are transmitted incorrectly, the parity bit will be incorrect, thus indicating that a parity error occurred in the transmission. The parity bit is only suitable for detecting errors; it cannot correct any errors, as there is no way to determine which particular bit is corrupted. The data must be discarded entirely, and re-transmitted from scratch. On a noisy transmission medium, successful transmission can therefore take a long time, or even never occur. However, parity has the advantage that it uses only a single bit and requires only a number of XOR gates to generate. See Hamming code for an example of an error-correcting code. Parity bit checking is used occasionally for transmitting ASCII characters, which have 7 bits, leaving the 8th bit as a parity bit. For example, the parity bit can be computed as follows, assuming we are sending simple 4-bit values 1001.

Type of bit parity
Successful transmission scenario
Even parity
A wants to transmit: 1001
A computes parity bit value: 1+0+0+1 (mod 2) = 0
A adds parity bit and sends: 10010
B receives: 10010
B computes parity: 1+0+0+1+0 (mod 2) = 0
B reports correct transmission after observing expected even result.
Odd parity
A wants to transmit: 1001
A computes parity bit value: 1+0+0+1 + 1 (mod 2) = 1
A adds parity bit and sends: 10011
B receives: 10011
B computes overall parity: 1+0+0+1+1 (mod 2) = 1
B reports correct transmission after observing expected result.

This mechanism enables the detection of single bit errors, because if one bit gets flipped due to line noise, there will be an incorrect number of ones in the received data. In the two examples above, B's calculated parity value matches the parity bit in its received value, indicating there are no single bit errors. Consider the following example with a transmission error in the second bit using XOR:

Type of bit parity error
Failed transmission scenario
Even parity
Error in the second bit
A wants to transmit: 1001
A computes parity bit value: 1^0^0^1 = 0
A adds parity bit and sends: 10010
...TRANSMISSION ERROR...
B receives: 11010
B computes overall parity: 1^1^0^1^0 = 1
B reports incorrect transmission after observing unexpected odd result.
Even parity
Error in the parity bit
A wants to transmit: 1001
A computes even parity value: 1^0^0^1 = 0
A sends: 10010
...TRANSMISSION ERROR...
B receives: 10011
B computes overall parity: 1^0^0^1^1 = 1
B reports incorrect transmission after observing unexpected odd result.

There is a limitation to parity schemes. A parity bit is only guaranteed to detect an odd number of bit errors. If an even number of bits have errors, the parity bit records the correct number of ones, even though the data is corrupt. (See also error detection and correction.) Consider the same example as before with an even number of corrupted bits:

Type of bit parity error
Failed transmission scenario
Even parity
Two corrupted bits
A wants to transmit: 1001
A computes even parity value: 1^0^0^1 = 0
A sends: 10010
...TRANSMISSION ERROR...
B receives: 11011
B computes overall parity: 1^1^0^1^1 = 0
B reports correct transmission though actually incorrect.
B observes even parity, as expected, thereby failing to catch the two bit errors.

Usage
Because of its simplicity, parity is used in many hardware applications where an operation can be repeated in case of difficulty, or where simply detecting the error is helpful. For example, the SCSI and PCI buses use parity to detect transmission errors, and many microprocessor instruction caches include parity protection. Because the I-cache data is just a copy of main memory, it can be disregarded and re-fetched if it is found to be corrupted.
In serial data transmission, a common format is 7 data bit, an even parity bit, and one or two stop bits. This format neatly accommodates all the 7-bit ASCII characters in a convenient 8-bit byte. Other formats are possible; 8 bits of data plus a parity bit can convey all 8-bit byte values.
In serial communication contexts, parity is usually generated and checked by interface hardware (e.g., a UART) and, on reception, the result made available to the CPU (and so to, for instance, the operating system) via a status bit in a hardware register in the interface hardware. Recovery from the error is usually done by retransmitting the data, the details of which are usually handled by software (e.g., the operating system I/O routines).

Computer Systems (FAST TRACK)

1     Data representation   1.1    Number systems   How and why computers use binary to represent all forms of data? •     Any form ...