Popular Posts

Sunday, May 16, 2010

Revising C++

I happened to explore the NIST's SAMATE database for insecure code over this weekend. The NIST SAMATE project is collecting examples of vulnerable code. It is designed to be used to "provide users, researchers, and software security assurance tool developers with a set of known security flaws.

Here is what I picked up:

1.    int main(int argc, char *argv[])
2.    {
3.      int loop_counter;
4.      char buf[10];
5.      for(loop_counter = 0; ; loop_counter++)
6.      {
7.        if (loop_counter > 4105) break;
8.        /*  BAD  */
9.        buf[4105] = 'A';
10.      }    
11.      return 0;
16.    }

So let’s start with problems in this code first.

Problems:

1. The first one is the breaking condition is placed in the middle of the loop although this will not create any runtime or compile time error but still it is not considered a good programming practice.

2. Terminating loop with break.

3. Assigning the value ‘A’ to a memory location outside the initialized space, which could result in a unexpected behavior of the program.

Solutions:

1. We can store the value ‘A’ on the buf’s reserved memory location (like from buf[0] to buf[9]) then we are able to see a defined behavior of this code. So if we replace the line buf[4105] = ‘A’; with buf[9] = ‘A’ then this code should run fine without any unexpected output, but it could substantially change the meaning of the code.

2. Another possible solution would be to increase the size of the char buf to a value bigger than 4105. This change would likely have been closest to the programmers original intention.

Are there anymore problems or solutions? Please share with me.

Sunday, March 21, 2010

Detailed Block Diagram-24 Hour Clock

I need 15 flip flops to divide the clock crystal frequency to make it a 1 and then it will go to the input of the first decade counter which will count up to 9 and it will reset itself after 9 and when it is resetting itself that input will go to next counter of the minutes part which will count up to 6 and that will be the input for the next counter which is the first one in the hour part this counter will count up to 3 and resets itself at 4 which will become the input for the next and last counter which count up to 2 as this circuit is for the 24 hour clock.

24 Hour Clock Block Diagram

 

Sunday, January 24, 2010

Arithmetic Logic Unit (ALU)

An arithmetic logic unit is a combinational logic circuit used to perform arithmetic and logic operations. The ALU has a number of selection lines to determine the operations to be performed. These selection lines are decoded within the ALU circuitry so that ‘N’ selection lines can select up to 2(power N) operations. Most common operations of ALU are addition, subtraction and comparison of bits.

Finally, I have completed its design architecture.

 ALU

Detailed Block Diagram of the ALU.

Monday, January 4, 2010

Mason Recognized in Top 100 of Academic Ranking of World Universities

By Catherine Ferraro

For the second year in a row, Mason was ranked as one of the top 100 North and Latin American universities by the Academic Ranking of World Universities. The analysis is conducted annually by Shanghai Jiao Tong University’s Institute of Higher Education.

Results can be found on the institute’s web site.

Universities are ranked by several indicators of academic or research performance. These include the number of alumni and staff members who have won Nobel Prizes or Fields Medals; the prevalence of highly cited researchers; the number of faculty articles published in the journals Nature and Science; and the frequency with which articles are indexed in major citations indices. The per capita academic performance of an institution is also considered.

“Mason is honored to be recognized for a second year in a row by Shanghai Jiao Tong University’s Academic Ranking of World Universities,” says Mason Provost Peter Stearns.

“This is an illustration of how committed Mason is to strengthening its relationships and boosting its global reputation with universities in the United States and abroad.”

As an institution that has made global education a priority, Mason offers a wide range of academic programs, from undergraduate degrees in global affairs and global and environmental change to doctoral programs in climate dynamics and other fields that foster global understanding. Several programs also require global residencies in which students learn how to live and work in a global society.

The university has also established research and educational collaborations abroad that provide opportunities for students and faculty members to work outside of the United States, participate in international research initiatives and address social issues around the world.

For example, the Sino-America 1+2+1 dual degree program, which Mason joined in 2004, is an international education initiative that brings American and Chinese universities together to offer dual degrees to Chinese undergraduate students.

In the program, students spend their freshman year at a Chinese university, their sophomore and junior years at an American university and their senior year back at their original university in China. After completing the program, students receive baccalaureate degrees from both schools.

The first 15 graduates of Mason’s 1+2+1 program received undergraduate degrees at a graduation ceremony in China in summer 2008, followed by 25 more students in summer 2009. Currently, there are approximately 90 students in the program in their second and third years of study.

Mason also provides its students opportunities to study almost anywhere in the world through its Center for Global Education. The center offers short-term, semester and yearlong honors study abroad; international internships; and intensive language programs in Asia, Africa, Europe, the Middle East, South America and the South Pacific.

Through Mason’s numerous centers and institutes, faculty members and students are working on some of the most pressing issues around the globe, including conflict analysis and resolution, Earth observing and space research, health policy research and international education.

Article Link : http://news.gmu.edu/articles/1173

Academic Ranking of World Universities – 2009 List : http://www.arwu.org/Americas2009.jsp