(Formerly known) C language is really a language that won't die (C/C ++) (C) (IC design) (de2) (nioii)

Source: Internet
Author: User

Today, we work on the lab designed jointly by hardware and software. After the CPU is designed, we burn it into the Cyclone II chip of Altera and use the following simple C language:ProgramTest whether the CPU design is successful.

1 # Define Switch_pio (volatile char X) 0x0000800
2 # Define Led_pio (char *) 0x0000810
3
4 Void Main () {
5While(1)
6*Led_pio= *Switch_pio;
7}
8
9

Switch_pio is pointer, which records the memory address of the switch's current data.
Led_pio is also pointer, recording the memory address of the current led data.

In an infinite loop, data from the memory address in switch _ PIO is continuously sent to the memory address in led_pio. Therefore, when switch is on, the LED will be on, when switch is off, the LED will be dark.

Therefore, the C language can capture values directly from the memory address, so that hardware data can be transferred to each other, so that all other languages will be dumped to the ground.

Therefore, the C language will not really die. It's okay if you try again in 100.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.