Developing a c program to practice arrays and bitwise operators

Read in 10 integers from the command line and store them in int arrayl. This part is
complete in the given starter program.
b. Reverse the order of array elements in int array_1 using swap _ints function. i.e. swap
I’ and 10′
element then 2nd and 9th and so on. (You can call swap_ints function within
a loop)
C.
Get an integer user input and add that number to all elements of the int array1 using
bitwise add function. (You can call bitwise add in a loop).
d.
Get the absolute values of numbers in int array_1 and save them back in the
uint array_1 array using bitwise abs function. Print all numbers within the
uint array_1 in a single line using display_array function.
e.
Get mod 32 of these unsigned integers using bitwise mod 32 function. (Hint: This can
be achieved bitwise by masking the 5 least significant bits in the integer number) and
save them into uint _array2. Print all numbers within the uint array2 in a single line
using display array function.
f.
Get an integer user input in the range of O to 31 and shift left each element of the
uint array2 with that number using bitwise_shift left function. Then print all elements”
of uint array2 using display_array function.
g. For each unsigned integer in uint _array2, in a separate line: print the number, number
of 1′ bits in the resulting binary representation by calling the function count_set_ bits
and print whether the number is even or odd using odd or even function.

Program Design

1. Suppose you are given a string s1, such as “psg”, representing the types of precious metal bars. Each character represents one type of metal bar, for example,‘p’ for platinum bar,‘s’ for silver bar, and ‘g’ for gold bar.
Another string s2 is given representing the bars you have, such as “abc”. Each character in s2 is a type of metal bar you have, for example,‘a’ for aluminum, ‘b’ for “brass”, ‘c’ for “copper”.
Write a program to calculate how many of the metal bars you have in s2 are in s1. Letters are case sensitive, so ‘a’ is considered a different type of metal barfrom‘A’.
Example input/output:
Enter s1: psg
Enter s2: abc
Output: 0

Enter s1: psg
Enter s2: ppbgc
Output: 3
1)Name your program metal.c.
2)Your program should include the following function:
int count(char *s1, char *s2);
The count function expects s1 and s2 to be strings. The function returns the number of characters in s2 are in s1. The count function should use pointer arithmetic (instead of array subscribing). In other words, eliminate the loop index variables and all use of the [] operator in the function.
3)Assume s1 and s2 have no more than 1000 characters.
4)String library functions areNOTallowedfor this program. If you use a string library function, you will not receive the credit for the count function part of the program.
5)To read a line of text, use the read_linefunction (the pointer version) in the lecture notes.

2. Command-line arguments
Modify project 2, problem 2 (validate words) so the word is a command-line argument. A word as a command-line argument is valid if all characters of the word are alphabetic letters and one of the following conditions holds:
1. All letters are capitals, like “UCLA”,
2. All letters are not capitals, like “program”.
Example input/output:
./a.out fall
Output: valid
./a.out 8littlepigs
Output: invalid
./a.out
Output: Incorrect number of arguments. Usage: ./a.out word
./a.out spring fall
Output: Incorrect number of arguments. Usage: ./a.out word
1)Name your program command_word.c.
2)The program should include the following function:
int validate(char *word);
The function expects “word” to point to a string containing the wordto be validated. The function returns 1 if word is valid, and 0 otherwise.The function should use pointer arithmetic (instead of array subscripting). In other words, eliminate the loop index variables and all use of the [] operator in the function.
3)The program shouldalsocheck if the correct number of arguments are entered on the command line. If an incorrect number of arguments are entered, the program should display a message.
4)The main function displays the output.

Programming discussion

It has to be using this language. Not integration of another language in this problem please.
http://processing.org
I would like to have someone who could do the work fast and efficiently and by giving me feedback as the work is being done. If it is done in a timely fashion I have three more assignment I will need help with . Thank you 

*Please give me feedback as the questions are answered one after the other please so I can comment them before my deadline.
Question 0 – Integrate Code
This code Tower Physics.zip has blocks with different forces assigned to it.  Make them into statues by using more or them or less to make a form without having them fall from the sky. They must be stable when you run the program. This must be done using arrays.
When the statues are done you must add them into this code. Working_Prototype_v1_1 2.zip this code has three levels to them You must integrate three different statues in them. This way when the ball touches them they fall over.

creating functions in c using bitwise operators

Read in 10 integers from the command line and store them in int arrayl. This part is
complete in the given starter program.
b. Reverse the order of array elements in int array_1 using swap _ints function. i.e. swap
I’ and 10′
element then 2nd and 9th and so on. (You can call swap_ints function within
a loop)
C.
Get an integer user input and add that number to all elements of the int array1 using
bitwise add function. (You can call bitwise add in a loop).
d.
Get the absolute values of numbers in int array_1 and save them back in the
uint array_1 array using bitwise abs function. Print all numbers within the
uint array_1 in a single line using display_array function.
e.
Get mod 32 of these unsigned integers using bitwise mod 32 function. (Hint: This can
be achieved bitwise by masking the 5 least significant bits in the integer number) and
save them into uint _array2. Print all numbers within the uint array2 in a single line
using display array function.
f.
Get an integer user input in the range of O to 31 and shift left each element of the
uint array2 with that number using bitwise_shift left function. Then print all elements”
of uint array2 using display_array function.
g. For each unsigned integer in uint _array2, in a separate line: print the number, number
of 1′ bits in the resulting binary representation by calling the function count_set_ bits
and print whether the number is even or odd using odd or even function.

Module 1 Critical Thinking

The firm that you work for is concerned about the malware attacks that have been occurring around the world. You have been asked by the head of the IT department to research two security breaches that have occurred in the last two years. One should be from the United States and the other from another country. Describe the details of each attack. Then, discuss how each could have been prevented and contained with applicable examples and details from this week’s readings.
Your paper should be 3-5 pages in length (excluding cover page and references page) and conform to CSU Global Writing Center (Links to an external site.). Include at least two scholarly references in addition to the course textbook, for a total of three sources minimum. The CSU Global Library (Links to an external site.) is a good place to find these references.

DAT 305: Data Structures For Problem Solving

This week’s challenge activities enabled you to use data structures, such as graphs and adjacency lists.
Write a 1- to 2-page reflection that describes the challenges you faced while completing the activities. How did recalling the definitions and concepts related to data structures and algorithms help you complete the activities? How will your understanding of these concepts and terms assist you in your future courses and career?

small verilog homework

1. In this question you are to implement the following truth table (where – represents a don’t care value) using the requested commands/styles in Verilog. Simulate each case using your testbench and then synthesize each version and submit the screen capture of the RTL view.
a b c y 0 0 0 1 0 0 1 1 0 1 0 – 0 1 1 – 1 0 0 0 1 0 1 0 1 1 0 1 1 1 1 0
Figure 1. Truth table for Question 1
a) Using concurrent continuous assignment(s)
b) Using behavioral code with case statement
c) Using behavioral code with if statement
d) Using structural code (implement the SUM-OF-PRODUCT representation of the circuit using primitive gates of AND, OR, and NOT.
e) Using reduction operators
2. In this question, you are asked to design a synthesizable ALU using the requested commands/styles in Verilog. This ALU gets two 8-bit inputs (A, B) and a 4-bit select input (S) based on which decides about the operation that should be executed (output Q is 8-bit). What follows shows these operations
: If S=0 => Addition (i.e., A B)
If S=1 => Subtraction (A-B)
If S=2 => Multiplication (only the least 8 significant bits are shown in output) 2
If S=3 => Shift A to the left B times (and add 0 from right side)
If S=4 => Rotate A to the right B times
If S=5 => A is ANDed with B
If S=6 => A is ORded with B
If S=7 => A is XORed with B
If S=8 => A is NANDed with B
If S=9 => Complement of A is computed
Design this ALU using the following code styles:
a) Using concurrent continuous assignment(s)
b) Using behavioral code with case statement
c) Using behavioral code with if statement
3. Reconsider question 2 with the assumption that the output is a registered output, i.e., Q is loaded by the rising edge of the clock signal when reset is not active (RESET=0). For this case consider a synchronous resetting mechanism (RESET only acts in the rising edge of the CLK signal). Implement the circuit with the following styles:
a) Using behavioral code with case statement
b) Using behavioral code with if statement
4. Leveraging the concatenation operator, create a module that accepts a 64-bit input X, and swaps pairs of even-and odd bytes to produce a 64-bit output U. The output should be registered using a clock signal CLK.
5. a) Design a 4-bit counter with inputs/outputs shown in Fig. 2. It should be a synchronous counter with asynchronous resetting mechanism and work as follows:
● If ENABLE=’0’, the output keeps its previous value regardless of other input values.
● If ENABLE=’1’ and LOAD=’1’, the 4-bit input value (V) is loaded into the counter with the rising edge of the CLK signal regardless of other input values.
● If ENABLE=’1’ and LOAD=’0’, then it counts synchronously up or down with rising edge of CLK based on the value of UP (if this value is ‘1’ it counts up, otherwise it counts down).
● The RCO output becomes ‘1’ only in the following cases:
⮚ when ENABLE=’1’ and UP=’1’ and Q=’1111’
⮚ when ENABLE=’1’ and UP=’0’ and Q=’0000’ 3
Note that all cases above occurs only if CLEAR=’0”. However, if CLEAR=’1’, both Q and RCO will be reset immediately (asynchronous resetting mechanism)
Figure 2. Diagram for the Counter in Question 5
b) Write a testbench for your circuit that does the following: -First it loads the value of 10 (decimal) in the counter, then starts counting down for 6 clock cycles. After that it counts up for 20 clock cycles.
c) Implement an 8-bit counter with the same specification using 2 samples of the circuit designed in part a. In this circuit RCO signal becomes ‘1’ in following cases
⮚ when ENABLE=’1’ and UP=’1’ and Q=’11111111’
⮚ when ENABLE=’1’ and UP=’0’ and Q=’00000000’
d) Write a testbench for your 8-bit counter that does the following: -First it loads the value of 122 (decimal) in the counter, then starts counting down for 124 clock cycles.