Microsoft Word - 22W CST8216 Lab Assignment 4 - Lab Week Twelve Instructions and Problem Details.docx
CST8216 Processor Architecture Lab Exercises Last Revision Winter 2022
Page 1 of 4 © 2022 D. Haley 22W CST8216 Lab Assignment 4 - Lab Week Twelve Instructions
Assignment XXXXXXXXXXmarks) – Lab Week 12 – Tying it all Together
Approximate time to complete: 3 – 4 hours.
Due Date:
By 11:30 PM Thursday, April 14, 2022– Assignment 4 – Submission Link for Lab Week 12 – Assignment 4
This is a HARD SUBMISSION DATE/TIME and NO late submissions will be accepted and your group will receive a mark of zero (0).
This link is for the submission of the following files:
22W_ISBN_Validation_Driver.asm, Sum_Products.asm and
Validate_ISBN.asm
You must also submit ISBN_Validation_Test_Plan.docx via this link.
Do NOT use a compressed file to submit your Assignment.
This lab exercise may be optionally performed by up to THREE students in the same lab section working as a group
(students pick their own partners). Also, ensure all student names/numbers are on all program listings and
documentation for all students to receive credit for the work (No name, no credit). There is only ONE submission
required per group of students – ENSURE THAT EVERYONE IN THE GROUP KNOWS WHO IS SUBMITTING THE
SOLUTIONS.
Notes:
1. If your name/student number is missing on the submitted code listings, no credit will be given for
the submission.
2. If your submission is submitted in a compressed file (e.g. zip), it will not be marked.
Purpose of the LAB:
The purpose of this lab is to further your understanding of 68HCS12 Assembly Language and Lecture theory by tying all
of our past learning together in a culminating assignment – ISBN Validation.
In previous labs, you wrote code to convert an ASCII character to a Digit. In another lab, you copied an array while
skipping a given value in the array. The next lab you wrote a subroutine that converts an array of ASCII characters to
an array of Digits, skipping a certain ASCII character in the ASCII array.
This lab uses material from previous Lectures, your previous experience in completing the course assignments, plus
Week 11’s lecture material to perform ISBN validation on a series of 6 ISBNs contained in an external file. To do so,
you will complete the provide starter code and display the results of the ISBN validation on the Simulator’s HEX
Displays.
This lab also builds upon Stack Operations and Subroutines, which you used for a previous lab with a counter and a
Subroutine to perform String to Digit conversion.
Because some students may not have completed all of the previous assignment that used the
ISBN_String_Conversion Subroutine, the CST8216 68HCS12 API Booklet ‐ Updated for 22W A4.pdf document
contains information on a new subroutine that must be used with this assignment – ISBN_String_Conversion.
You will have to read the API document in order to incorporate the Subroutine into this assignment, using
the provided API_A4.s19 file.
Each lab section has a compressed file set that must be used for this assignment. I recommend that you read
the contents of these file sets this week.
CST8216 Processor Architecture Lab Exercises Last Revision Winter 2022
Page 2 of 4 © 2022 D. Haley 22W CST8216 Lab Assignment 4 - Lab Week Twelve Instructions
The Problem Details for this assignment are on the pages following this one.
Lab Week 12 – Assignment 4 – Problem Details
Congratulations! The CST8216 Book Publishing Company have contracted you to write a software application that
automates the current manual process used to validate International Standard Book Numbers (ISBNs). These are
unique IBSNs used by "thousands and thousands" of Book Merchants to validate the authenticity of purchased books.
The uniqueness of these IBSNs that they are either 13 or 10 Digits in length; however, we have been contracted to
validate only those ISBNs that are 10 Digits in length, noting that the length does not include any hyphens “-“ in the
ISBN.
For example, the Joyce Farrell text used in CST8116 has an ISBN-10 of “ XXXXXXXXXX”, which we
treat as a String. For IBSN validation, we analyze the “digits” form of the ISBN, which in this case
would be XXXXXXXXXX.
In the case of the Almy text used for this portion of CST8216, it has an ISBN-10
of “ XXXXXXXXXX”, which we treated as a String. For IBSN validation, we analyze
the “digits” form of the ISBN, which in the case of the Almy text would be
XXXXXXXXXX.
The Current Manual Process of ISBN-10 Validation
Some of the sources of information used for this assignment were based loosely upon,
https://isbn-information.com/the-10-digit-isbn.html and
https://www.instructables.com/How-to-verify-a-ISBN/
noting that these sources use a “10 to 1” Method of Validation, but we will use a “1 to 10” Method.
Once the Book Publishing Company has received a shipment of textbooks, a manual check of the IBSN is conducted
using a “pencil and paper” method to perform the calculations required to validate the authenticity of the ISBN. Here are
the steps: Extract the Digits “Extracted Numbers” from the “ISBN to Validate”. For each Digit (D), multiply it by the
Multiplier (M) to obtain (DxM). Then, Sum the Products (SOPs) of all the (DxM) values and divide the SOPs by 11
($0B). If the Remainder = $00 (0), then the ISBN is Valid; otherwise, the ISBN is Not Valid.
Joyce Farrell Text example – valid ISBN: Remainder is zero (0).
Almy Text example – valid ISBN: Remainder is zero (0).
If, for example, one of the numbers in the ISBN was incorrect, then the validation would produce the following example
results:
Non-Authorized Version of Joyce Farrell Text example – Invalid ISBN: Remainder is not zero (0).
Confirmation of Valid ISBN <== Calculated Valid Results
1 to 10 Method <== Change these values to get Valid/Invalid Results
Digit (D XXXXXXXXXX5 Base 10: Sum of Products (SOPs) 176
Multiplier (M XXXXXXXXXX10 Base 16: SOPs $B0
Base 10: Product (DxM XXXXXXXXXX63 50 Base 10: SOPS/11 16.0
Base 16: Product (DxM) $01 $06 $09 $1C $05 $00 $0E $00 $3F $32 Base 16: SOPs/$0B $10
Remainder $00
Result Valid ISBN
ISBN to Validate Extracted Numbers
XXXXXXXXXX‐337‐10207‐5
Confirmation of Valid ISBN
1 to 10 Method
Digit (D XXXXXXXXXX1 Base 10: Sum of Products (SOPs) 198
Multiplier (M XXXXXXXXXX10 Base 16: SOPs $C6
Base 1: Product (DxM XXXXXXXXXX XXXXXXXXXXBase 10: SOPS/11 18.0
Base 16: Product (DxM) $01 $08 $12 $0C $23 $12 $38 $28 $00 $0A Base 16: SOPs/$0B $12
Remainder $00
Result Valid ISBN
ISBN to Validate Extracted Numbers
XXXXXXXXXX
1 to 10 Method
Digit (D XXXXXXXXXX5 Base 10: Sum of Products (SOPs) 184
Multiplier (M XXXXXXXXXX10 Base 16: SOPs $B8
Base 10: Product (DxM XXXXXXXXXX63 50 Base 10: SOPS/11 16.7
Base 16: Product (DxM) $01 $06 $09 $1C $05 $00 $0E $08 $3F $32 Base 16: SOPs/$0B $10
Remainder $08
Result Invalid ISBN
XXXXXXXXXX‐337‐10217‐5
CST8216 Processor Architecture Lab Exercises Last Revision Winter 2022
Page 3 of 4 © 2022 D. Haley 22W CST8216 Lab Assignment 4 - Lab Week Twelve Instructions
The Future Automated Process of ISBN Validation
In the business of Software Engineering many manual processes are automated to improve
efficiency, risk management and customer satisfaction.
In a fully implemented system, we could scan ISBNs using a device such as the one depicted to the
right. However, before adding such a device to our system, we would first have to prove that the
functionality of the software is correct. As such, we will simulate the actual reading of the ISBNs
using an external data file that contains exactly six ISBNs, which we will read into our
assembly language program. Note that the illustrated data file contains the ISBNs from a
previous lab and is not the file you will use for your submission. Rather, each lab
section will have its own data file for ISBN Validation.
As we iterate through the values, we will keep track of the Number of Valid ISBNs and the
Number of Invalid ISBNs. An example result, using the ISBN.txt file from a previous
Assignment (illustrated to the right) is illustrated below.
Development Requirements and Constraints – The Test Plan
The first thing you should do is to create a test plan of your program run BEFORE ANY CODE IS WRITTEN. It must
contain the calculations that prove the validity of your results using the provided ISBN-10 validation algorithm. Your
test plan must be based upon the file of ISBNs for your lab section. Students having trouble with this assignment will be
asked to provide their test plan prior to receiving any assistance.
Here are some sample results of the validation of the ISBNs from a previous assignment – your assignment submission
would use the lab section specific data file and you must validate all six ISBNs and summarize the results as shown
below. Note that you have been provided with a 22W Assignment 4 - ISBN Validation - Blank Sheet.xlxs file to complete
and hand in with your submission.
SUMMARY OF TEST CASE CALCULATIONS (EXPECTED RESULTS)
File Name Used: ISBN.txt (Use the name of your Lab Section’s file here)
List the ISBNs in their String below
fcc "0‐684‐84438‐5"
fcc "9971‐5‐0210‐0"
fcc "93‐80954‐21‐4"
fcc "0‐584‐84328‐5"
fcc "950‐425‐059‐0"
fcc "960‐425‐059‐0"
Expected Results from calculated values above:
Number of Valid ISBNs: 2
Number of InValid ISBNs: 4
CST8216 Processor Architecture Lab Exercises Last Revision Winter 2022
Page 4 of 4 © 2022 D. Haley 22W CST8216 Lab Assignment 4 - Lab Week Twelve Instructions
Development Requirements and Constraints – Coding
You must use the supplied starter code for 22W_IBSN_Validation_Driver.asm as your starting point. As you will see,
some of the code has been predefined for your mandatory use and annotated “Do NOT change” within that file. There is
also an algorithm provided to assist you in coding your solution. Pay particular attention to the labels
Number_Of_Valid_ISBNs and Number_Of_InValid_ISBNs and how they are used; otherwise, the supplied code that
outputs the results to the HEX displays will not correctly function.
Starter code is also supplied for the two subroutines that you must write – Sum_Products.asm and
Validate_ISBN.asm, using the ISBN 1 to 10 Method for validation as outlined in this document and by following the
instructions contained in the starter code files.
In addition, you should review the Subroutines – Rule Set for CST8216 – 29 March 2022 Update.pdf document to
ensure that you are conforming to best practices for coding subroutines. It is included in this assignment package
Development Requirements and Constraints – Program Output
Using the ISBN.txt file from an earlier lab, the test plan provide us with the following Expected Results:
Number of Valid ISBNs: 2
Number of InValid ISBNs: 4
A screen shot of the program output on the HEX Displays is illustrated.
Your solution to your provided ISBNs should also display a certain Number of Valid
ISBNs as well as a certain Number of InValid ISBNs.
Note that if the program is run more than once in the Simulator – e.g. File Reset,
then clicking on Go, the same valid results must be correctly calculated by your
solution and correctly displayed on the HEX Displays.
Approach to Development
There are at least a couple of methods one can use in Software Development:
the “Big Bang” approach where all of the code is written at once and then “fingers are crossed” hoping that the
code works first time; or
the “Incremental” approach where you “code a bit, test a bit.” That is, you start off with the starter code in the
Driver program, then add functionality to it as you go along.
o In this assignment, you may wish one group member to code Sum_Products.asm and write a small
driver program to send it one array to test the subroutine’s functionality against the test plan.
o In parallel, you could have another group member code Validate_ISBN.asm and write another small
driver program to send in a SOP value to test the subroutine’s functionality against the test plan.
o Once you have that functionality working you can incorporate it into the Driver program then start
looking at the iteration portion of the Driver where it must loop through all of the ISBNs, updating the
valid and invalid results as appropriate.