CS4051 Fundamentals of Computing
Modeling of an Application Summary This is an individual coursework worth 60% of the total module mark. It requires developing a software application which simulates the behaviour of a digital circuit performing integer addition and writing a report to describe the model, algorithm, data structures needed as well as the program developed.
1. Construct a model (represented by a picture) of a byte adder assembled using electronic gates based on the model of the bit adder.
2. Specify an algorithm for two bytes addition based on bitwise operations.
3. Select suitable Python data structures to represent the information to be processed by the program.
4. Create a program in Python 3 which implements the model of the adder as designed in the previous task
5. Test the program with selected test data.
6. Write a report to present the work above.
7. Describe a specific procedure for a research of your interest
The detail of each task is illustrated below.
- The model must be based on the bit adder from the lecture in Week 2
- The model may include number of bit adders linked to form a byte adder.
- The model can be presented using suitable diagram/picture created using drawing tool or graphics editor of your choice (the bit adder can be a box with input and output only as shown in the lecture of Week 2)
- The algorithm for two bytes addition must be based on the use of standard logical operations (e.g. AND, OR, XOR, NOT)
- It can use additional data processing operations which might be necessary to manipulate the data (e.g., input/output operations, type conversion operations)
- Your main inputs (i.e., two bytes) are commonly two binary strings. If your two inputs are two integers in Base 10, you have to process extra logic, if it is valid, you will get extra 1-5 marks in this task and task-4 depending on the complexity (However, the total marks will not exceed 60 marks).
- A bitwise “AND” operation based on character as an example is given here, but in this task, you have to use pseudocode, structured English or plain text instead of Python code. def AND_operation(x,y): if x=='1' and y=='1': return '1' else: return '0'
- You are expected to fully understand the how the bit adder works, e.g. what gates and input are involved to produce the sum and carry, and how the sum and carry are produced.
- The algorithm must be specified using pseudocode, structured English or plain text
- The algorithm can be illustrated using a diagram
3. Data Structures
- The programming should be done using data structures and operations in Python for input/output, character and string processing, logical or bitwise manipulations.
- It can use any primitive or complex data structures which might be necessary for holding the data (pairs, lists, strings, dictionaries, etc.) • The data structures as a topic are covered in Week-5, but they are also covered throughout the module.
- The program must work in a loop, reading two binary strings, computing the sum of them and printing out the result until instructed to quit
- The program needs to check the input data for the data type permitted and the data value limitations (min 00000000 and max 11111111 in Base 2 or min 0 and max 255 in Base 10 for positive integers)
- You may only consider the positive integers addition. If you also consider the signed integers (data value limitations: min 10000000 and max 01111111 in Base 2 or min -128 and max +127 in Base 10 for signed integers), and it works successfully, extra marks 1-5 will be added depending on the complexity (However, the total marks will not exceed 60 marks)
- The program must be implemented in a modular way with separate functions for inputting data, logical operations, arithmetic operations and outputting the result of the calculation
- The tests must be performed after completing the development in order to gather suitable data for reporting
- The tests may require writing additional functions for performing the testing which make use of the functions which perform the computations
- The test data used for testing the programs must include normal data, special values (if any), max/min values, wrong data types, wrong values
- The report must present all components of the work – model, algorithm, data structures, program and testing
- The program must be described in terms of its structure and behaviour. It can be presented using text and structural charts, flowcharts or other diagrams as needed
- The tests must be described in terms of testing cases (or scenarios), input data, expected results, actual results and analysis of the results. They can be presented in a table form reporting each case separately and can be illustrated using screen shots of the execution.
- You need to use “print screen” key to catch the testing results shown on the computer screen, and include the pictures in the report. You are encouraged to include other “print screens” for description purpose.
- It must be written in proofread English in good style
- The report must have a title page, table of content, page numbers and reflection on the individual experience gained during working on the coursework 7. A specific procedure for a research of your interest
- Give a title to your research
- Illustrate specific data source(s) used for analysis (either give web link(s) of data source or API/tools used to collect)
- Illustrate the technology you are going to use for data analysis, how you are going to apply the technology, how the technology works briefly in your research case, and what results you may expect from the analysis
Add references if you use some words from public sources (e.g. books, journals, websites)
Write maximum one page for this task (half page is adequate though), and add this into your report. Deliverables Written report (.pdf or .docx) and Python program, submitted by the deadline to WebLearn (one .zip file) Marking Scheme
1. Construct a model of a byte adder assembled using electronic gates 5 based on the model of the bit adder or other possible models
2. Specify an algorithm for integer addition which uses 10 bitwise operations
3. Select suitable Python data structures to represent the information to be 5 Processed by the program
4. Program 15 5. Testing 5 6. Report 15 7. Research procedure 5 Total max 60 Notes on the Assessment
The work will be assessed entirely based on the submitted files.
If no program file is submitted the report will still be assessed for the description and the testing but it is highly likely a fail.
If no report is submitted only the program will be assessed, it may also risk a fail.
If both files are present but the program is not working the report will still be assessed for the description of the program and for the testing and some marks will be awarded for the program.
In order to be awarded top first class mark (A, A+), you may consider some or all of these more advanced features in task 2, 4 and 5: ? Allowing both positive and negative integers to be entered ? Input in both binary and decimal format with conversion to binary ? Additional binary subtractor or multiplier