This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Wire.h> | |
#define SLAVE_ADDRESS 0x04 | |
int number = 0; | |
int state = 0; | |
void setup() | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setup() { | |
// initialize serial communication: | |
// pinMode(P) | |
Serial.begin(9600); | |
pinMode(PD_1, OUTPUT); | |
pinMode(PD_7, INPUT); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// // Define a function to calculate the factorial of a 4-bit number. The output | |
// // is a 32-bit value. Invoke the function by using stimulus and check the results | |
module factorial; | |
reg [3:0] in; | |
function calc_factorial; | |
input [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Things to do Today: | |
☐ Study guide for Embedded systems | |
☐ Understand nyquist criterion and how it applies | |
☐ Analog to digital conversion problem | |
Using the successive approximation algorithm | |
☐ find info on the book about fixed point algorithm | |
☐ Find info on digital to analog converter problems that includes hardware | |
☐ Assembly code | |
write instruction code , use your own code | |
☐ Write a small C function |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "inc/tm4c123gh6pm.h" | |
void PORTF_INIT(void) | |
{ | |
SYSCTL_RCGCGPIO_R |= 0x01;// activate the clock | |
while((SYSCTL_RCGCGPIO_R & 0x01) == 0) | |
{ | |
} | |
GPIO_PORTA_LOCK_R = 0x4C4F434B; //unluck GPIO PORT A | |
GPIO_PORTA_CR_R = 0xFF; //allows changes to PA7-0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module mult (a, b, start, clk, r, done); | |
input [7:0] a, b; | |
input start, clk; | |
output [15:0] r; | |
output done | |
endmodule | |
`timescale 1ns/100ps | |
module TestBench6.1; | |
reg [7:0] a, b; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2.1a) 0(M), 2(M), 4(M), 0(M), 2(M), 4(M), 0(M), 2(M), 4(M) - 0 Hits | |
2.1b) 0(M), 2(M), 4(M), 2(H), 0(M), 2(H), 4(M), 0(M), 2(M) - 2 Hits | |
2.2a) 0(M), 2(M), 4(M), 0(H), 2(M), 4(H), 0(M), 2(H), 4(M) - 3 Hits | |
2.2b) 0(M), 2(M), 4(M), 2(M), 0(H), 2(H), 4(M), 0(H), 2(M) - 3 Hits | |
3.a) 2^x = 16 where X is the bits used for the offset which is 4 | |
3.b) 128 * 1024 = 131072 / 16 = 8192 | |
2^X = 8192 where X is the index which is 13 bits | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class test | |
{ | |
private int var = 3; | |
String one; | |
one = "this is just a test"; | |
public static void main(String[] args) |