Implement a cyclic redundancy check algorithm

Assignment Help Assembly Language
Reference no: EM131900232

1. Goals and Overview
1) Develop practical knowledge of x64 Assembly Language including Branches, Arithmetic and Logic Operations
2) Interface with C programs using the System V x6,4 calling convention
3) Optimize Assembly code using Conditional Moves to replace branches
4) Access unidimensional arrays using Assembly

2 Development Setup
For this programming assignment you must work individually. You will work in the CS Linux Lab located in FAB 88-09 and 88-10.

For this Homework you rr ust use x64 Assembly (AT & T Syntax) and Make. Please refrain from using C code, any language extensions or 3: party libraries. We will use the GNU Assembler (As), the GNU C Compiler (gcc) and Make already installed in the development machines in the lab.

Grading will be done in this setup so please make sure that your code works under this conditions.

3 Introduction

In this Homework we will implement a Cyclic Redundancy Check algorithm (CRC) in Assembly. CRC is an Error Detecting Algorithm based on cyclic codes. CRC is widely used in many systems including USEL Bluetooth, the Dallas 1-wire bus, Zlib and ESM and CDMA cellphone networks. It is very fast and efficient to implement in hardware and software.

CRC is computed as the polynomial division of the Message M divided by the CRC Polynomial C. The checksum takes the form of the reminder R resulting from dividing M/C. There are many variants based on different polynomials. The length of the resulting checksum depends on the length of the CRC Polynomial.

Our implementation will use CRC-8. This particular implementation of CRC output an 8-bit signature and it U5e50x5D as the CRC Polynomial,

4 Problem Description

4.1 Fast CRC Implementation
Our CRC-8 implementation will be based on the fact that the number of residues for a given CRC polynomial is fixed. So we can precompute even possible residue and use that table to compute the CRC for a given message. For the case of CRC-8 we have 256 possible residues, so the size of the precomputed CRC table i5 256 bytes.

4.2 Assembly Implementation
You are provided with a complete solution of the CRC-8 algorithm in C containing the Fast CRC-8 algorithm in crc.c and a main function that takes as parameter a string in the command line with the message and calls CRCInit0 and CRCFa5ta.

your job in this assignment: is to write a replacement of CRCInit() and CRCFast() in assembly (crca1.S). The main C function provided in hw3.c should be able to link to the new object file assembled (crca1.0). The resulting linked executable file should be named hw3al.

You must not make any changes to the structure or implementation of hw3.c and you must follow all the calling conventions necessary to interface with the provide hw3.c file.

4.3 Optimized Assembly Implementation
As mentioned in class If/Else blocks in which the outcome if difficult to predict are very impactful in the performance of modern micro architectures. To avoid this problems most modern ISA provide support of Conditional Moves in which the If/Else block can be replaced by a Conditional Move that involves no change in the Program Counter 14,.1P). As part of this Homework, you must also provide an optimized assembly version based on crcal.5 that removes the if condition in the CRCInit() function. You can identify this condition in line 30 of file crc.c. You must replace your original assembly code for this If condition with a Conditional Move and submit it as crca2.S. The main C function provided in hw3.c should be able to link to the new object file assembled (crca2.0). The resulting linked executable file should be named hw32.2.

4.3 makefile

As part of your program your solution you should augment the provided makefile so that it automatically compiles all the 3 variants of the code: Executable using C Version of CRC named hw3 (provided). Executable using Assembly Version of CRC with If/Else branches named hw3a1 and Executable using Optimized Assembly version with Conditional Move instructions named hw3a 2. Your makefile must also provide a cleanup entry (make clean) to delete all the files generated by the compilation process object files, executables, libraries, etc.)

5 Implementation Overview
You can start with the assembly 'Hello World" program discussed during class and remove the parts you do not need. These are a few key concepts you must address as part of your implementation:

1) You must create a Data segment to store global variables and a Text segment to write your code. Please consider using the following assembler directives.: .text and .data

2) You must allocate an array in the data segment to be able to hold the CRC Table. You must use an assembler directive. You might consider using .byte, .rep( and .endr

3) You must declare the names of both CRCInit and CRCFast as global symbols in your Assembly file 50 that the linker can find them and properly interface to then'. Notice that the names of these two labels in assembly need to match the names of the functions in C or the linking process will fail. Also note that the names are case sensitive. Please consider using the assembler directive .global

4) your functions must respect the System V calling conventions by preserving the values of the callee-saved registers as discussed in lecture.

5) your function must follow the System V calling Conventions for parameters passing arid function return so that your code can interface with the function caller (hw3..c).

6) Both of your assembly implementations must return the exact same values as the provided implementation in C.
6. Hand-In
For submission, you should provide only source code (*,S, *.c) and a Makefile script as outlined in

Section 4.3. More specifically you must provide the original unchanged crc.c file, the non-optimized assembly CRC version in crcla.5, the optimized assembly CRC version in crc 2a.S and the Makefile.

Please pack your files into a TAR file with the following filename structure Please replace "oclinid'' with your ODIN id.

Attachment:- hw.rar

Reference no: EM131900232

Questions Cloud

Journalize the transactions above in a general journal : Journalize the transactions above in a general journal for Schmidt Inc. assuming that they use the periodic system
Focusing on black death and the renaissance : Discuss the social, economic, religious, and population impact of the Black Death.
How does virgil aeneid imitate homer : How does Virgil's Aeneid imitate Homer's Iliad and why does Virgil use Homer so much?
Challenging the catholic church : Was Martin Luther correct in his actions by challenging the Catholic Church? Explain why.
Implement a cyclic redundancy check algorithm : complete solution of the CRC-8 algorithm in C containing the Fast CRC-8 algorithm in crc.c and a main function that takes as parameter a string in the command
Focus of soranus and hippocrates : What is ancient medicine in the relation of ancient gynecology with a focus of soranus and hippocrates?
Could a liability account ever have a debit balance : Could an asset account ever have a credit balance? Could a liability account ever have a debit balance
Focusing on the the fall of rome : Focusing on the The Fall of Rome-There were many factors that led to their eventual decline and downfall.
Compute the planned production of finished goods : Compute the planned production of finished goods (in units). Compute the cost of finished goods manufactured. Compute the cost of goods sold.

Reviews

Write a Review

Assembly Language Questions & Answers

  Create a assembly language subroutine

Create a assembly language subroutine MULSUM that takes an array named A containing n bytes of positive numbers, and fills two arrays, array B containing n words and array C containing n long words

  Write a function in linux assembly

Write a function in Linux assembly

  Analog measurements

Prepare an assembly program for the correctly measures the wind direction

  Design a simple digital clock

Design a simple digital clock

  Write an assembly program

Prepare an Assembly program that reads in a number of cents.

  Write an assembly language program

Write an assembly language program for encrypting alphabates of a string

  Greatest common divisor of integers-masm assembly language

Must be done in MASM assembly language: Greatest common divisor of two integers is largest integer which will evenly divide both integers. GCD algorithm involves integer division in a loop.

  Write assembly program-find right admission price to movie

Write the Assembly program to find correct admission price to movie. Price of admission to a movie is $7 for kids (under 12) and $9 for adults.

  Create simple 8-bit alu using add-subtract-shift functions

Create a simple 8-bit ALU. Requirements:The eight functions that you will implement are: add, subtract, and, or, shift left logical, less than, shift right logical.

  Write assembly program print binary representation-integers

Write the assembly program called hw6_ex1, stored in file hw6_ex1.asm. This program must prompt user to enter signed 32-bit integer. Program must print out binary representation of the integer.

  Allot op-codes and add microcode to microprogram

Allot op-codes and add microcode to microprogram of Mic-1 to implement following instructions which are then included with IJVM instruction set.

  Write mips assembly program to read two non-negative numbers

Write MIPS assembly program to repeatedly read two non-negative integers and print integer product and quotient without using multiplication and division instructions.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd