Computers and Technology

Fix the broken c code. the program should blink the greenled every half second, but the red led is steadily lit. youmay not delete or add code, you may only change valuesbeing stored in a variable or register. time an iteration of the delay subroutine using the cpu timerand breakpoints.#include /* * fix this code! you may not delete or add code, you may only change values being stored in a variable or register. */void delay(); unsigned int cls(unsigned int x); unsigned int crs(unsigned int x); int main(void) { wdtctl = wdtpw | wdthold; volatile unsigned int m = 1; volatile unsigned int s = 0; volatile unsigned int p = 65535; p1dir |= m; while(s) { p = crs(p); p1out = p; delay(); }}void delay(){ volatile unsigned int i = 25; volatile unsigned int j = 0; volatile unsigned int k = 1; volatile unsigned int l = 0; for(; i > 0; { j += 2; k += 2; } l = cls(j + k); }unsigned int cls(unsigned int x){ return (x < < 1) | (x > > 15); }unsigned int crs(unsigned int x){ return (x > > 1) | (x < < 15); }

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 15:40, qhenley
Most networking media send data using in which data is represented by only two discrete states: 0s and 1s. a. digital signals b. contiguous signals c. ramp signals d. exponential signals
Answers: 1
image
Computers and Technology, 21.06.2019 22:00, karena13aguirre
Problems: 1. using textbooks, reference books, and internet as your source of research, draw the following microprocessor microarchitectures i. intel 8086 ii. motorola 68000 i atmel atmega32 iv. mips single cycle v. arm cortex-m3 write an hdl module for a hexadecimal seven-segment display decoder. the input is 4-bit binary representing a hex number (0-f), and the output is 8-bit seven segment display bits (a-h). thus, the decoder must handle the digits 10 - 15 to display a-f respectively, in addition to 0-9 numbers. 2. design a 4-bit left and right rotator (both outputs). first sketch schematic diagrams of your design. then implement your design using hdl coding. 3. 4. design a modified priority encoder that receives an 8-bit input, a7: 0 and produces a 3-bit output, y2o. y indicates the most significant bit of the input that is true. y should be 0 if none of the inputs are true. give a simplified boolean equation, sketch a schematic, and write an hdl code. 5.write an 8: 1 multiplexer module called mux8 with selection inputs s, data input d, and data output y. data input (d) and data output (v) are 32-bit wide
Answers: 3
image
Computers and Technology, 22.06.2019 11:00, tristina20
The isometric projection camera technique provides an illusion of perspective by using things like parallax scrolling to create the illusion of 3d in a 2d game
Answers: 3
image
Computers and Technology, 22.06.2019 12:10, drelisech6467
Linux is distributed under gnu gpl. why is this important? a. it ensures that only torvalds can profit from the sale of linux b. it prevents unknowledgeable users from downloading programs they don't know how to operate. c. it provides protection for the developers who created linux. d. it states that anyone can copy, modify, and share the program if changes are made public.
Answers: 1
Do you know the correct answer?
Fix the broken c code. the program should blink the greenled every half second, but the red led is s...

Questions in other subjects:

Konu
Mathematics, 10.11.2020 03:20
Konu
Mathematics, 10.11.2020 03:20