The program should print out the binary representation


Question One:
Write an assembly program called hw6_ex1, stored in file hw6_ex1.asm. This program should prompt the user to enter a signed 32-bit integer. The program should print out the binary representation of the integer.
Here is an example interaction with the program:
% ./hw6_ex1
Enter an integer: 324
The binary representation is: 00000000000000000000000101000100
% ./hw6_ex1
Enter an integer: -13523
The binary representation is: 11111111111111111100101100101101
You can assume that the user always enters a number (and not random input).

Extend the program from the previous question so that it prints out the number of times the motif "1101" occurs in the binary representation of the entered number. For instance, the number "1101101001101" would contain the motif 3 times. Note that the occurrences of the motif can overlap. Motif recognition and identification is a very important problem in many areas (computer vision, bioinformatics, automated learning, searching), and this is a very, very simple example of it.
Here is an example interaction with the program:
% ./hw6_ex2
Enter an integer: 4321
The binary representation is: 00000000000000000001000011100001
The number of '1101' motifs is: 0
% ./hw6_ex2
Enter an integer: 123041231
The binary representation is: 00000111010101010111010111001111
The number of '1101' motifs is: 2
% ./hw6_ex2
Enter an integer: 14540253
The binary representation is: 00000000110111011101110111011101
The number of '1101' motifs is: 6
Again, you can assume that the user always enters a valid integer. 

Request for Solution File

Ask an Expert for Answer!!
Programming Languages: The program should print out the binary representation
Reference No:- TGS0116319

Expected delivery within 24 Hours