Posts

Showing posts from March, 2020

Lab 6 - Algorithm Selection Lab

Image
Introduction This post is the contents of experiments I found during the lab 6. Lab 6 is the Algorithm Selection Lab. I observed different types of algorithms, compiled them, and checked what are the differences. The detailed contents will be described below. Lab 6 There are three source files name 'vol1.c', 'vol2.c', and 'vol3.c' that contains different types of algorithm. The algorithms are to change the volume of the digital sound. The basic or Naive algorithm ( vol1.c ). This approach multiplies each sound sample by 0.75, casting from signed 16-bit integer to floating point and back again. Casting between integer and floating-point can be  expensive  operations. A lookup-based algorithm ( vol2.c ). This approach uses a pre-calculated table of all 65536 possible results, and looks up each sample in that table instead of multiplying. A fixed-point algorithm ( vol3.c ). This approach uses fixed-point math and bit shifting to perform the multiplication w

Project Stage 1 - Compiling and Benchmark Butteraugli

Image
Introduction This post is about the project I am working on the SPO600 class. I will benchmark one open-source, profile it, and optimize the project. The requirements for this project are the following: The running time has to be more than 4 minutes The open-source software package has to include a CPU-intensive function or method The open source software package has to implement in a language that compiles to machine code (such as C, C++, or Assembler) The detailed project instruction can be found on the  Winter 2020 SPO600 Project , I had the struggle to find a proper open-source with the requirement. I narrowed down the type of software I want to work on and found the open-source that is proper for this project. I will describe what is a project I selected, the ways I build and compile the open-source, how to benchmark the project. The Project I Selected: Butteraugli The Butteraugli is the project Google created. It estimates the psychovisual similarity of two images. Th

Lab 4 (6502 Assembly Language String Lab): Option 1: Adding Calculator

Introduction In this posting, I will describe a design and implementation for option 1, lab 4: Adding Calculator. There is a previous posting to describe a code for option 4: Screen Colour Selector . Option 1: Adding Calculator Create a subroutine which enables the user to enter two numbers of up to two digits. Indicate where the cursor is, and allow the user to use the digit keys (0-9), backspace, and enter keys. Return the user's input value in the accumulator (A) register. Using this subroutine, write a program which adds the two numbers (each of which is in the range 0-99) and print the result. The detailed instruction for this lab is demonstrated here . 1. Design 1.1. Pseudo Code Store "Enter the first number", "Enter the second number", "result" to output on the screen Print the "Enter the first number: " Receive the first number from the user. User can use enter to store the number and backspace to erase a number Store

Lab 5: 64-bit Assembler - x86_64

Image
Instruction This posting will describe the process and the finding of lab 5. This posting only covers x86_64. The explanation for Aarch64 is described in the previous posting:  Lab 5: 64-bit Assembler - Aarch64 .  You can see  the detailed instruction of the lab5  on the Seneca SPO600 website. The Brief Instruction of the Lab 5 about Aarch64 There are four representative part of the Lab 5 Take a look at the code using 'objdump -d objectfile' using aarch64 assembly language programs Take a look at the code using 'objdump -d objectfile' using x86_64 assembly language programs Write code to loop a message with digit using Aarch64 assembly language programs Write code to loop a message with digit using x86_64 assembly language programs This posting only covers the x86_64 part. 'Objdump -d hello' using Aarch64 language programs The <main> section in the output of 'objdump -d' command using x86_64 language programs is below. hello