Connection on Arduino Mega

Hallo, I attached a Picture.

My question now is, how do I have to connect this Pins to the Arduino Mega.
Where do I have to connect the 74LS00N parts (which Pins) then the top left parts with the 10KOhm resistors and the part which is on Pin 5?

This is the Software for the Controller:
http://surasto.de/cms/download.php?cat=60_Elektronik&file=ArduinoCNC.pde&PHPSESSID=2tdnlsraqaipd5gc9p94fiq317

Can anybody help me

thx

Unfortunately that sketch doesn't use a #defines section to assign pin
numbers to names, so without editing it you'll have to stick to the same
wiring.

The comment at the top does relate Arduino pin numbers to function though.

The diagram has a raw ATmega chip in there - you can relate Arduino pin numbers
to AVR pin names thus:

Arduino / AVR
2 / PD2
3 / PD3
4 / PD4
5 / PD5
6 / PD6
7 / PD7

8 / PB0
9 / PB1
10 / PB2
11 / PB3
12 / PB4
13 / PB5

A0 / PC0
A1 / PC1
A2 / PC2
A3 / PC3
A4 / PC4
A5 / PC5

Ah ok perfekt txt for this thats exacly what I need maybe I will change it to define.