Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
12408 Discussions

a calculator using altera monitor program

Altera_Forum
Honored Contributor I
779 Views

I am working on altera De2-70 board, using altera monitor program. i am continuously getting errors for syntax in c on altera monitor program. does it use different syntax or just same as c programming? 

 

 

 

 

 

 

 

 

 

 

 

/* //the worked simple blink code  

# define switches (volatile char *) 0x0002000  

# define leds (char *) 0x0002010  

void main(){  

while (1)  

*leds = *switches; 

}*/
0 Kudos
1 Reply
Altera_Forum
Honored Contributor I
124 Views

"00111000" is a octal number 

"111000" would be decimal 

"0b00111000" would be binary 

 

To get "A" use: A = (*switches>>0) & 0x07; B= (*switches>> 3) & 0x7; op = (*switches >> 6) & 0x3;
Reply