Week 1 - Digital Systems.pdf

Full Transcript

COM1006 Devices and Networks 1: Digital Systems Devices AND Networks Autumn: Devices Spring: Networks Dr Ramsay Taylor [email protected] Dr Prosanta Gope Course Delivery this Semester Lectures (like this one) ○ but don’t sit there in silence! Lab sheets on Thursdays ○ Try things, a...

COM1006 Devices and Networks 1: Digital Systems Devices AND Networks Autumn: Devices Spring: Networks Dr Ramsay Taylor [email protected] Dr Prosanta Gope Course Delivery this Semester Lectures (like this one) ○ but don’t sit there in silence! Lab sheets on Thursdays ○ Try things, ask questions, get feedback Assessment Semester 1: Threshold Assessment Quizes Semester 2: Threshold Assessment Quizes Summer 2023: Grading Exam Threshold Assessment! You shouldn’t be able to “pass” a module without actually understanding at least the basics of all the sections. This matters for things like Accreditation, and for your Degree to actually mean something! If you do understand the basics of all the sections, you should be concentrating on showing you’ve learnt something interesting, not on passing or failing. Threshold Assessment! There will be 3 “quizzes” in weeks 4, 8, and 11. You must get 7/10 to pass each quiz. You can have a second attempt if you fail. If you pass all the threshold tests*, you automatically pass the module (*there will be more next semester) Threshold Assessment! Next semester there will be some threshold assessment too. Your grade for the module will then be based on the Grading Assessment (an exam in the summer for this module) Then there will be a grading exam in the summer for the entire module. Any questions? This week: ● ● ● ● Analogue vs Digital Systems Discus how data is represented in computers Introduce Binary and Hexadecimal numbers Convert between number representations Analogue Systems Analogue values vary continuously - they can have any value within their possible range. Classical analogue electronic values are Voltage and Current Digital Systems Digital systems consist of discrete values. Not necessarily just two! Digital Systems Digital Analogue? Digital Systems Digital systems are much more resistant to noise. Modern digital systems tend to be binary Binary signals can only be 0 or 1 Representing Values If we use binary digital signals, then a signal can only be 0 or 1. That’s 2 possibilities: Representing Values But, what if we want to count to 2? Or 3? We will need 2 binary digital signals: Representing Values With 2 signals, we can have 4 values. What those 4 values mean (encode) is actually completely arbitrary Ocelot Lobster Badger Send more beer! Representing Numbers Conventionally we talk about them as numbers in Base 2 0 2 1 3 Representing Numbers It’s called Base 2 because there are 2 symbols (0 and 1) in each position. You are used to working with 10 symbols in each position: 0,1,2,3,4,5,6,7,8,9 Representing Numbers When you run out of symbols in the Least Significant position, you increment the next position by 1 and go back to the start. Representing Numbers So, we start at zero, and go up in 1s: 1 0001 9 1001 2 0010 10 1010 3 0011 11 1011 4 0100 12 1100 5 0101 13 1101 6 0110 14 1110 7 0111 15 1111 8 1000 16 10000 Representing Numbers This works for any number of symbols you like, and it really doesn’t matter what the symbols are so long as we agree on what order they are in. Representing Numbers As well as Binary and Decimal, we can use Octal: 0,1,2,3,4,5,6,7 Or Hexadecimal: 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F These have advantages when converting binary systems! Bits, Bytes, Nibbles and Words We tend to call one binary signal or position a Bit 8 bits together can represent 256 different values, and this collection is called a Byte 4 bits (i.e. half a byte!) is sometimes called a Nibble A Word is several bytes (or, sometimes any collection of bits that isn’t 8). How many bits depends on the Word Length of whatever we are doing. Word Lengths and Ranges Notice that our top row of values is both possibilities for the top bit, with 0 in the bottom bit. Then both with 1 in the bottom bit: 0 2 1 3 Word Lengths and Ranges If we added a 3rd bit, we could have these 4 values with that bit sert 0, and then these 4 again with that bit set 1: Word Lengths and Ranges If we added a 4th bit, we could have these 8 with that bit set to 0, and…. You get the idea! Word Lengths and Ranges If we are working in Base 2, then a word with n bits can represent 2n different values. If you are working in Base 10, a 6 digit number can represent 106 different values: 000,000 (A.K.A 0!) through 999,999. If you are working in Base 16, a 2 digit number can represent 256 different values: 00 through FF ...Wait, 256 sounds familiar... Why Hex is Cool One Hexadecimal digit “rolls over” at the same count as 4 binary digits. This means we can succinctly and easily convert between Hex and Binary, e.g.: 1010 0100 A 4 1101 1110 1010 1101 1011 1110 1110 1111 D E A D B E E F Why Hex is Cool Just 16 patterns to learn and you can do any size binary to Hex and back: 1 0001 9 1001 2 0010 A 1010 3 0011 B 1011 4 0100 C 1100 5 0101 D 1101 6 0110 E 1110 7 0111 F 1111 8 1000 0 0000 Decimal to Binary Converting decimal to binary is trickier. There are some processes - you should find what works for you! This is Dirk’s: 1. Successively divide the number by 2 and record the remainder (which is either 0 or 1). 2. Stop when the result of the division is 0. 3. Remainders read “backwards” give binary number. Decimal to Binary Binary to Decimal. Characters If we want to represent letters and words, we can assign bit patterns to specific letters of the Alphabet. How we do that could be arbitrary, but if we want to exchange information with anyone else we need to agree on a system. Most computer systems use the American Standard Code for Information Interchange (ASCII). Characters Original ASCII had 128 characters (7bit). Extended ASCII has 256 characters. This includes upper and lower case Latin Characters (A-Z), numerical digits (‘0’-’9’), and a range of punctuation. It doesn’t include Greek, Cyrilic, Hiragana, or even begin to cover Chinese! Characters Unicode expands the globally-agreed “bit patterns to characters” set to include a lot more. The first 256 Unicode characters match the 256 ASCII characters Summary ● Digital Systems allow us to handle noise ● We can represent (positive, integer) numbers using Binary bits ● We can represent numbers in a range of Bases ● Hex (and Octal) are handy for working with Binary numbers ● ASCII is a set of Binary to Character mappings ● Unicode is a bigger one!

Use Quizgecko on...
Browser
Browser