首页 > 其他分享 >4CCS1CS1 计算机系统

4CCS1CS1 计算机系统

时间:2023-11-22 19:57:10浏览次数:39  
标签:计算机系统 use code should will program 4CCS1CS1 your

使用实验室5的电路,你应该编写一个程序来显示你的国王K号的数字LED上。让你的程序分别写出你的K数的每个数字,写出最左边的数字 数字优先。例如,如果您的K编号是K1070542,那么您的程序将首先写出一个1,接着是0,然后是7,然后是0,接着是5,然后是4,最后是2。每个数字应显示1秒。 2显示您的首字母缩写(20个标记)你现在应该修改你的程序,这样它也会显示你名字首字母的二进制编码已完成显示您的K号码。有很多方法可以将字母数字字符编码为二进制,最常见的是ASCII。然而我们将使用我们自己的字母数字字符编码。我们将假定“A”是十进制值1,“B”是2,“C”是3,依此类推。在这种编码中,“Z”应该是26。同样,您可以使用查在本文档稍后的部分中查找将要显示的等效二进制值,并随附您还应该显示一个句号“.”,我们将假定其被编码为值27, 在你的首字母之间。例如,Ada Lovelace的程序会首先显示她的K号码。然后程序会显示值1(00001,表示‘a’),然后显示值27(11011,表示“.”),然值12(01100,表示“l”)。

Coursework Assignment
4CCS1CS1 Computer Systems
Introduction
This is a summative coursework for CS1. It counts for 15% of your final module grade. The assignment
provides you with the opportunity to apply your knowledge and skills that you’ve gained from previous
labs to some new tasks. You will need to write an assembly program, which will then be submitted to
KEATS as a single .s file.
You have just under two weeks to complete the assignment. The deadline for submission is Friday
24th November 18:00. The suggested time to spend on the coursework is 8–10 hours.
In the labs following submission of the coursework, you will review each others programs and provide
feedback to each other. This peer review is a mandatory part of the assessment, and non-participation
in the review activity will result in your coursework mark being capped at 40%.
1 Display your k-number (15 marks)
Using the circuit from Lab 5, you should write a program to display the digits of your King’s K-number
on the LEDs.
Have your program write out each digit of your K-number separately, writing the left-most numerical
digit first. For example, if your K-number is K1070542, then your program will first write out a 1,
followed by a 0, then a 7, then a 0, then a 5, then a 4, and finally a 2. Each number should be
displayed for 1 second.
2 Display your initials (20 marks)
You should now modify your program so that it also displays a binary encoding of your initials after it
has finished displaying your K-number.
There are many ways to encode alphanumeric characters in binary, the most common is ASCII. However,
we will use our own encoding of alphanumeric characters. We will assume an ‘A’ is the decimal value 1,
a ‘B’ is 2, a ‘C’ is 3 and so on. In this encoding, ‘Z’ would be 26. Again, you can use the look-up table
later in this document to find the equivalent binary values that you will display, and accompanying
hexadecimal values.
You should also display a full stop character ‘.’, which we will assume is encoded as the value 27,
between your initials.
For example, Ada Lovelace’s program would first display her K-number. The program would then
display the value 1 (00001, representing ‘a’), then the value 27 (11011, representing ‘.’), and then the
value 12 (01100, representing ’l’).
1
Decimal Digit Hexademical Equivalent Binary Number Representation
0 0x00 0 0 0 0 0 0 0 0
1 0x01 0 0 0 0 0 0 0 1
2 0x02 0 0 0 0 0 0 1 0
3 0x03 0 0 0 0 0 0 1 1
4 0x04 0 0 0 0 0 1 0 0
5 0x05 0 0 0 0 0 1 0 1
6 0x06 0 0 0 0 0 1 1 0
7 0x07 0 0 0 0 0 1 1 1
8 0x08 0 0 0 0 1 0 0 0
9 0x09 0 0 0 0 1 0 0 1
10 0x0A 0 0 0 0 1 0 1 0
11 0x0B 0 0 0 0 1 0 1 1
12 0x0C 0 0 0 0 1 1 0 0
13 0x0D 0 0 0 0 1 1 0 1
14 0x0E 0 0 0 0 1 1 1 0
15 0x0F 0 0 0 0 1 1 1 1
16 0x10 0 0 0 1 0 0 0 0
17 0x11 0 0 0 1 0 0 0 1
18 0x12 0 0 0 1 0 0 1 0
19 0x13 0 0 0 1 0 0 1 1
20 0x14 0 0 0 1 0 1 0 0
21 0x15 0 0 0 1 0 1 0 1
22 0x16 0 0 0 1 0 1 1 0
23 0x17 0 0 0 1 0 1 1 1
24 0x18 0 0 0 1 1 0 0 0
25 0x19 0 0 0 1 1 0 0 1
26 0x1A 0 0 0 1 1 0 1 0
27 0x1B 0 0 0 1 1 0 1 1
7 6 5 4 3 2 1 0 <bit position
2
Display Morse Code (10 marks)
You will now extend your program to communicate Morse code on the LEDs.
What is Morse code? Morse code is a method of transmitting text information as a series of on-off
tones, lights, or clicks that can be directly understood by a skilled listener or observer without special
equipment. (https://en.wikipedia.org/wiki/Morse_code).
Below is the International Morse Code Roman alphabet.
Your base program will blink a 3 letter sequence in Morse code on the LEDs. You three letter sequence
is the first three letters of your first name.
• For example, Charles Babbage’s code would be CHA.
• If your first name is less than three characters, you should use the first 3 characters of your first
name concatenated with your surname. For example, Jo Rowling’s code would be JOR.
3
So that we can perceive the Morse code, we will use a unit length of 200 milliseconds (ms). This
means the duration of a dot is 200 ms, and a dash is 600 ms.
For example, if your sequence was ABC, then your program would run as follows:
1. Turn ON the LED for 200 ms for the first dot of the letter A
2. Turn OFF the LED for 200 ms for the inter-part space of the letter A
3. Turn ON the LED for 600 ms for the first dash of the letter A
4. Turn OFF the LED for 600 ms for the inter-letter space between the letters A and B
5. Turn ON the LED for 600 ms for the first dash of the letter B
6. ... and so forth
7. Until the last dot of letter C
8. Turn OFF the LED for 1400 ms for the inter-word space.
9. Loop back to the beginning of the Morse code sequence
3 Odd, Even, modulo 5 (15 marks)
Extend your program as follows.
• The Morse code sequence should loop 50 times (1–50).
• On odd iterations (1, 3, 5, ..., 49) your three characters should be displayed in their normal order.
– e.g. ABC
• On even iterations (2, 4, 6, ..., 50) your three characters should be displayed in reverse order.
– e.g. CBA
Using comments, you should explain how you have implemented the check of whether the iteration is
even or odd.
Once you have this behaviour working, you should again extend your program as follows.
• On iterations that are divisible by 5 (5, 10, 15, ..., 50) your program should display a ‘5’ after
what would normally be displayed on that iteration.
– e.g. ABC5 or CBA5
4 Ping-pong (20 marks)
Once the Morse code sequence has terminated, your LEDs should display a repeating pattern.
You should use the LEDs to display a ping-pong like pattern, where only a single LED is on at a time,
and it appears to move back and forth across the LEDS.
• 1000 → 0100 → 0010 → 0001 → 0010 → 0100 → 1000 → ...
It is left up to you to determine a suitable time to display each pattern for.
4
Submission instructions
• You should submit a single .s file named assignment.s via KEATS.
• DO NOT put your program in a .zip, .7z, or any other archive, DO NOT submit your program
as a .doc, .pdf, or any other format other than .s.
• This coursework uses ‘Model 4’ for use of generative AI. That is, you can use generative AI to
help you with the coursework. However:
– I have tried to use it myself for completing the coursework, it was not very helpful. Do not
expect generative AI to spit out complete assembly programs for you.
– You should make it clear in the comments where and how you have used generative AI.
– It is your responsibility to ensure any code produced by generative AI is ‘fair use’.
Mark scheme
• There are 100 marks available in total.
• Marks for correctness are awarded according to the number of marks for that task (80 marks).
• Marks for readability and style are also awarded (20 marks).
– Is your code structured and neat?
– Is your code commented well?
– Have you made use good use of the constructs we’ve covered in previous labs, e.g. functions,
conditionals, and loops.
5

标签:计算机系统,use,code,should,will,program,4CCS1CS1,your
From: https://www.cnblogs.com/whenjava/p/17850147.html

相关文章

  • 计算机组成原理:一、计算机系统概述
    参考视频:王道计算机考研计算机组成原理_哔哩哔哩_bilibili1.硬件的发展2.硬件的基本组成2.1冯诺依曼结构逻辑结构:特点:指令和数据以同等地位存储在存储器中,可以按照地址寻访。指令由操作码和地址码组成。以运算器为中心。这会带来一个问题:运算器本身是用来计算的......
  • 计算机系统的组成
    近年来,随着PC(PersonalComputer,个人电脑)在家庭中的广泛普及,计算机对我们的生活产生了深远的影响。如今,不仅是PC,与我们生活息息相关的手机、平板等也广泛应用了计算机。通过此文来介绍一下计算机系统的构成要素及其功能。什么是计算机?计算机是根据程序进行运算和数据处理......
  • 计算机系统概述
    计算机硬件的基本组成早期冯诺伊曼机输入设备:将信息转换成机器能识别的形式运算器:存放数据和程序运算器:算数运算和逻辑运算输出设备:将结果转换成人们熟悉的形式控制器:指挥程序运行冯诺伊曼计算机的特点计算机由五大部件组成指令和数据以同等地位存于存储器,可按地址寻访......
  • 计算机系统基础之相关例题概述
    例题一在网络安全管理中,加强内防内控可采取的策略有:1、终端访问授权,防止合法终端越权访问;2、加强终端的安全检查与策略管理;3、加强员工上网行为管理与违规审计;(其中,控制终端接入数量,不属于内防内控)例题二--简单算术表达式的结构例题三--移臂调度这个还需要我再探索一下......
  • 计算机系统漫游
    写在最前面的话:在大一下学期的时候其实就已经萌生了读完csapp并做完里面所有lab的想法,但当时痴迷于acm所以最后以失败告终。现在大二上的我对自己的目标更加清晰,希望这次自己可以坚持下去1.信息就是位+上下文拿一个最简单的hello程序举例#include<stdio.h>intmain(){......
  • 第一章 计算机系统概述 1.2.4计算机系统的层次结构
    计算机是一个硬软件组成的综合体先谈硬件:第一层:微程序机器M0(微指令系统)由硬件直接执行微指令这是一个实在的硬件层第二层:传统机器M1(用机器语言的机器)用微指令解释机器指令这是一个实际的机器层再谈软件:第三层:虚拟机器M2(操作系统机器)用机器语言......
  • 7、计算机系统组成
    计算机系统组成1、计算机的系统组成概念一个完整的计算机系统是由软件,和硬件一起组成的硬件:是各种物理设备的集合(看得见摸得着的,实实在在存在的东西),由(控制器、运算器,存储器,输入设备和输出设备组成)软件:计算机上的各种程序(文档和数据的总称),有系统软件和应用软件**只有硬件没......
  • 第一章 计算机系统概述
    1.2.2计算机硬件系统由运算器,储存器,控制器,输入设备,输出设备5大部件组成,主观上来说最初的CPU=运算器+控制器先详细介绍一下储存器:储存器主要分为主储存器和辅助储存器,CPU能够直接访问的是主储存器。主储存器的工作方式是按存储单元的地址进行存取,称为按地址存取方式。......
  • 第一章 计算机系统概述
    一.基本组成1.计算机包含四个主要的结构:处理器:控制计算机的操作,并执行数据处理的功能。当只有一个处理器时,被称为中央处理单元(cpu)内存:存储数据和程序。这种存储通常易失,关机时内存数据会丢失。磁盘存储器中的数据即使计算机系统关闭也会被保留。内存称为主存,硬盘为辅存......
  • 【软考-信息系统管理工程师】-1-计算机系统知识部分查漏补缺
    奇校验/偶校验校验类型和校验位数错误的影响采用奇校验方法,如果有奇数个数据位出错,能检测出错误,但不能纠正错误。奇校验通过将一个固定位数的数据块中二进制数值的总和的奇偶性进行检查来确定数据的正确性。如果某个数据位出错,则检查结果的奇偶性会发生变化,从而可以检测出......