Networks and the web · A level · OCR H446 1.3.3, AQA 7517 4.9.1.1, Eduqas A500QS 2.2 · about 25 min
Serial and parallel, synchronous and asynchronous, baud rate, bit rate, bandwidth, latency and protocols.
[1 mark]Why is serial transmission preferred to parallel over long distances?
[1 mark]In asynchronous serial transmission, what is the purpose of the start bit?
[1 mark]A link uses 16 different signal levels and a baud rate of 2400. What is its bit rate in bits per second?
[1 mark]What does this program print?
baud = 4800 bits_per_frame = 1 + 8 + 1 print(baud // bits_per_frame, 'characters per second')
[1 mark]Which statement about bandwidth and bit rate is correct?
The LED can be a one-wire serial line: white for 1, off for 0.
Write frame(ch). Its input ch is a single character with a code from 0 to 255. It returns a string of exactly 10 characters, each 0 or 1: a start bit 0, the 8 data bits of the character's code least significant bit first, then a stop bit 1.
For each character of Hi!, in order:
1. print the character, a space and its frame, for example H 0000100101;
2. put each of the 10 bits on the LED in turn, led("white") for 1 and led("off") for 0, with wait(0.05) after each.
Then print bits sent: <n>, where n is the number of bits you put on the LED, counted by your loop. Last, print how long 1200 characters take at 9600 baud with a 2-level signal, using the length of one frame: time for 1200 characters: <seconds> s, where seconds is the result of the division printed as Python prints it.
# the two lines every program starts with: the commands, then the robot
from bugbot import *
connect()
BAUD = 9600
def frame(ch):
data = format(ord(ch), "08b")
return data
for ch in "Hi!":
print(ch, frame(ch))Plan your program here, then type it in and press Run.
unframe(bits) that checks the start and stop bits and returns the character, or None if the framing is wrong.bit_rate.