1 / 14

TRACE TABLES

TRACE TABLES. REVIEW QUESTION. We have studied methods of identifying and rectifying errors in data transmission. One of the methods is Hamming Code. The Hexadecimal ASCII code for the letter D is 44, apply EVEN parity Hamming Code so that we can transmit the ASCII character G

Télécharger la présentation

TRACE TABLES

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. TRACE TABLES

  2. REVIEW QUESTION • We have studied methods of identifying and rectifying errors in data transmission. One of the methods is Hamming Code. • The Hexadecimal ASCII code for the letter D is 44, apply EVEN parity Hamming Code so that we can transmit the ASCII character G • NB – You only need 7 bits

  3. TRACE TABLES • Atechnique used to test algorithms to make sure that no logical errors occur • Hand tracing or 'dry running' allows you to use a trace table to: • see what code will do before you have to run it • find where errors in your code are

  4. The exam will normally ask you to create a trace table of some sort so you need to be very confident with them. • The exam will usually give you the headings but just in case, there are several steps in making a trace table, the first one is to note the table headings, this involves the following: • VARIABLES: note all the variables in the piece of code you are looking at (this includes arrays).Note each variable as a heading • OUTPUTS: note if there is an output and put this as a heading • INPUTS: if there are inputs specified, put an inputs column and be prepared to fill it in.

  5. It is very easy to jump right in when filling in trace tables, but you must be careful. The exam will try and trick you, so trying to predict what a trace table will do it not a good idea. In fact, the best idea is to switch your brain off and tackle the problem line by line, exactly as a computer would. Take a look at the following example:

  6. Taking a program like the one below we need to keep track (trace) all the variables and outputs.

  7. Note all the variables: num array / sum / avg / x Note if there is an output: yes If there are inputs specified: no So we should construct the following trace table:

  8. Now looking at the names of the variables you might be tempted to add all the values in the array together to find the sum, and then find the average number from this calculation . However, you'd be wrong, create a trace table and see if you can find the correct answer:

  9. The Number input is 39

  10. What does the Function Do?

  11. May 2011 Question 6 • May 2010 Question 4

More Related